示例#1
0
        public async Task <IEnumerable <Chatroom> > GetAllAsync(ApplicationUser user)
        {
            if (user == null)
            {
                return(null);
            }
            IEnumerable <Chatroom> chatrooms = _mappingService.EntitiesToDtos(await _repository.GetOwnedChatroomsAsync(user.Id));

            foreach (Chatroom cr in chatrooms)
            {
                cr.IsOwner = true;
            }
            return(chatrooms);
        }
示例#2
0
 public async Task <IEnumerable <Chatroom> > GetParticipatedChatroomsAsync(string userID)
 {
     return(_chatroomMappingService.EntitiesToDtos(await _repository.GetParticipatedChatroomsAsync(userID)));
 }