Пример #1
0
 public Task <bool> IsPersonInGroup(Guid personId, Guid groupId)
 {
     return(_orgGroupRepository.GetWithParentsWhere(group =>
                                                    group.Id == _personRepository.PeopleWithStaffBasic
                                                    .Where(person => person.Id == personId)
                                                    .Select(basic => basic.Staff.OrgGroupId)
                                                    .Single()
                                                    ).AnyAsync(group => group.Id == groupId));
 }
Пример #2
0
        public void ShouldGetParentsOrdered()
        {
            var orgGroups = _groupRepository.GetWithParentsWhere(group => @group.Id == org1a.Id)
                            .Select(group => group.Id).ToList();

            ShouldMatchOrder(orgGroups,
                             new[]
            {
                org1a.Id,
                org1.Id,
                orgRoot.Id,
            });
            orgGroups = _groupRepository.GetWithParentsWhere(group => @group.Id == org2a.Id)
                        .Select(group => group.Id).ToList();
            ShouldMatchOrder(orgGroups,
                             new[]
            {
                org2a.Id,
                org2.Id,
                orgRoot.Id,
            });
        }