1) Create a strongly typed class
public class ProfileEntity
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Address { get; set; }
}
2) create a new list of the
ProfileEntity
class as
var profiles = (from d in db.Profiles.ToList()
where d.Username == User.Identity.Name
select new ProfileEntity() { Address = d.Address , FirstName =d.FirstName }).ToList();
note: in the view, you have to use the
model as
ProfileEntity