i want to be able to do such a projection:
var result = from record in MyTable
select MapTo( record );
/*
select new RecordModel( )
{
RecordId = record.Id,
Property1 = record.Property1
};
*/
private RecordModel MapTo( MyTable dbRecord )
{
return new RecordModel( )
{
RecordId = dbRecord.Id,
Property1 = dbRecord.Property1
};
}
but i always get a 'NotSupportedException' (has no supported translation to sql). I'm not sure if this is even possible but it would be nice^^
Maybe this is possible when i use an expression but i don't know how to code such an expression.