/// <inheritdoc/> public ChannelDataDto CreateDto(Channel sourceObject) { var dto = new ChannelDataDto { Id = sourceObject.Id, Messages = _messageFactory.CreateDtoList(sourceObject.Messages) }; return(dto); }
/// <inheritdoc/> public ServerDataDto CreateDto(Server sourceObject) { var dto = new ServerDataDto { Id = sourceObject.Id, ChannelList = _channelFactory.CreateDtoList(sourceObject.Channels), UserList = _userFactory.CreateDtoList(sourceObject.Users) }; return(dto); }
/// <inheritdoc/> public List <MessageDto> GetChannelMessages(int channelId, IChatDtoFactory <Message, MessageDto> dtoFactory, IChatEntityRepositoryProxy <Channel, ChatDbContext> channelRepo) { var channel = channelRepo.Find(channelId); _requestValidator.IsChannelRequestValid(channel, channel.Server, _user, PermissionTypes.CanView); //TODO Pagination, return 20-40 messages in one batch return(dtoFactory.CreateDtoList(channel.Messages)); }
/// <inheritdoc/> public List <ServerIconDto> GetUserServers(IChatDtoFactory <Server, ServerIconDto> dtoFactory) { return(dtoFactory.CreateDtoList(_user.Servers)); }