Assume I have a table with more than 1000000 columns. When I use LINQ To SQL
and Entity-Framework
all queries will write in c# like below:
EFContext.MyTableName.Where(row=>row.column1==someValue)
.Select(...)
.FirstOrDefault(...)
.Any(...)
...
How to get only and only some columns of entity? Are there any way to get only columns 1 & 2 & 3 among 1000000 columns for example?
Attention:
Type of resulted data should keep after selection, for example if without filtering some columns type of result is Type1 it's very important that after filtering, type of result be Type1 but value of those properties of Type1 which are filtered should be null or default.