2
Answers

How to convert anonymous type to my database type

Asp.Net Hein

Asp.Net Hein

8y
271
1
var user = (db.Users.Where(u => u.CountryId == c)).Select(u=> new { u.UserName, u.Email, u.Country.Name, u.PhoneNumber, u.LastLogin });
 
 
In this code, the datatype of 'Select' part is 'anonymous'. I don't want anonymous datatype and I want db.Users type. Kindly let me know how to solve this and thanks a lot for viewing my question.  
Answers (2)