コード例 #1
0
 public StructuralGroup GetRoot()  //TODO: Make this a ViewModel
 {
     using (var structureRepository = new StructureRepository(ApplicationContext.DatabaseContext.Database, ApplicationContext.Services.MemberService))
     {
         return(structureRepository.GetRootForMember(Members.GetCurrentMember()));
     }
 }
コード例 #2
0
 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);
     }
 }