I have a Customer class with CustomId, CustomerName, Age, Sex, BirthDate. If I only want to retrieve CustomerId and Age column, how can I write code for filling Customer class with two columns?
1 Answer, 1 is accepted
0
Accepted
Doroteya
Telerik team
answered on 29 Nov 2012, 10:57 AM
Hello John,
The best way to retrieve a subset of columns from a given class is by LINQ. The necessary statement should look like this:
IList<Customer> result = (from customers in dbContext.Customers