public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Message = MessageApiModel.FromMessage(await _context.Messages
                                               .Include(x => x.Tenant)
                                               .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
Пример #2
0
            public async Task <Response> Handle(Request request)
            {
                var messages = await _context.Messages
                               .Include(x => x.Tenant)
                               .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                               .ToListAsync();

                return(new Response()
                {
                    Messages = messages.Select(x => MessageApiModel.FromMessage(x)).ToList()
                });
            }