Type Inference, Extension Methods and Fluent APIs in C#
So Type Inference is pretty cool, so are Extension Methods. And of course Fluent APIs help making code that calls your API look beter and more readable.
My colleague Martijn works on NEST, a .NET client for elasticsearch written in C#. I occasionally help him out and we discus design patterns like these fluent APIs. But he ran into a problem a while ago, which we couldn't figure out a solution to, so we let things rest.
Working on a pet project I discovered that you can make Extenstion method generic and it got me thinking...
My efforts resulted in a github repo with test code and a very long stackoverflow question http://stackoverflow.com/questions/16442596/extension-methods-and-type-inference.
If you know a solution, Martijn and I would be very happy to know about it!















