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); }
public async Task <IEnumerable <Chatroom> > GetParticipatedChatroomsAsync(string userID) { return(_chatroomMappingService.EntitiesToDtos(await _repository.GetParticipatedChatroomsAsync(userID))); }