I have a class Something
that implements ISomething
. How can I convert/cast from an IQueryable<Something>
to an IQueryable<ISomething>
. When I try to cast, I am able to compile, but the result of the cast is always NULL.
Background: The reason I am doing this is because my Something
class is a CodeSmith-generated class (PLINQO template) that has table mapping decoration, methods, etc. My ISomething
interface is "POCO-style", in that it is dumb and simply mirrors the properties of the Something
class. It also exists in it's own namespace. I am doing this so I don't have to reference the assembly that holds the Something
class from my service layer. The assembly that holds the Something
class will only need to be referenced in my repository layer now.