I\'m having a little bit of trouble understanding what the problem is here. I have a bit of code that pulls records from a database using LINQ and puts them into an object
Does it still fail if you change this:
select new SomeObject { ... } as ISomeTable;
to this:
select (ISomeTable) new SomeObject { ... };
?
If so (as I see you've confirmed), perhaps this has to do with the fact that an interface implementation could be either a class or a struct? Does the problem still appear if you cast to an abstract class rather than an interface?