Example #1
0
        public async Task <ActionResult <MessageDto[]> > GetMessagesByChannelId(
            int channelId,
            [Required] DateTime newerThan)

        => (await _unitOfWork.MessageRepository
            .GetMessagesByChannelIdAndNewerThan(channelId, newerThan))
        .Select(message => MessageMapper.MapToDto(message))
        .ToArray();
 public async Task <ActionResult <MessageDto[]> > GetMessagesNewerThanAsync(DateTime newerThan)
 => (await _unitOfWork.MessageRepository
     .GetMessagesNewerThan(newerThan))
 .Select(message => MessageMapper.MapToDto(message))
 .ToArray();