Asp.Net Hein

Asp.Net Hein

  • NA
  • 266
  • 167.4k

How to convert anonymous type to my database type

Jun 17 2016 4:50 AM
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)