Пример #1
0
        public CodingEventDto GetCodingEventById(long codingEventId, ClaimsPrincipal authedUser)
        {
            var requestingMember =
                _authedUserService.ConvertAuthedUserToMember(codingEventId, authedUser);

            return(_dbContext.CodingEvents.Find(codingEventId)?.ToMemberDto(requestingMember));
        }
Пример #2
0
        public List <MemberDto> GetMembersList(long codingEventId, ClaimsPrincipal authedUser)
        {
            var requestingMember =
                _authedUserService.ConvertAuthedUserToMember(codingEventId, authedUser);

            var codingEvent = _dbContext.CodingEvents.Include(ce => ce.Members)
                              .ThenInclude(m => m.User)
                              .SingleOrDefault(ce => ce.Id == codingEventId);


            return(codingEvent?.Members.Select(member => member.ToDto(requestingMember)).ToList());
        }