public StructuralGroup GetRoot() //TODO: Make this a ViewModel { using (var structureRepository = new StructureRepository(ApplicationContext.DatabaseContext.Database, ApplicationContext.Services.MemberService)) { return(structureRepository.GetRootForMember(Members.GetCurrentMember())); } }
public IEnumerable <StructuralGroupViewModel> GetLeaves() { using (var structureRepository = new StructureRepository(ApplicationContext.DatabaseContext.Database, ApplicationContext.Services.MemberService)) { var root = structureRepository.GetRootForMember(Members.GetCurrentMember()); var leaves = new List <StructuralGroup>(); structureRepository.PopulateLeaves(root, leaves); var viewModels = leaves.Select(StructuralGroupViewModel.FromModel); return(viewModels); } }