I use Entity Framework and MVC. I need Address list order by address id. But when i encapsulate property my for the sort so entity framework doesn't fill address list. what can i do?
public class Student
{
public int StudentId { get; set; }
public string Name{ get; set; }
public string Surname{ get; set; }
//i need this address list order by address id???
public virtual List<StudentAddress> Address { get; set; }
}
public class StudentAddress
{
[Key]
public int AddressId{ get; set; }
public string Address { get; set; }
public string City { get; set; }
}