I have a entity(SystemUnit), which contains collection of sub entities(Roles):
public partial class SystemUnit
{
public SystemUnit()
{
this.Roles = new HashSet<Role>();
this.Childs = new HashSet<SystemUnit>();
}
public int Id { get; set; }
public Nullable<int> ParentId { get; set; }
public int SystemUnitTypeId { get; set; }
public string Name { get; set; }
public virtual SystemUnitType SystemUnitType { get; set; }
public virtual ICollection<Role> Roles { get; set; }
public virtual ICollection<SystemUnit> Childs { get; set; }
public virtual SystemUnit Parent { get; set; }
}
I need using entity framework to get all system units, ordered by Id Asc with included Roles, ordered by id desc. Newbee in linq (