Exemplo n.º 1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Conversation = ConversationApiModel.FromConversation(await _context.Conversations
                                                              .Include(x => x.Tenant)
                                                              .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
            public async Task <Response> Handle(Request request)
            {
                var conversations = await _context.Conversations
                                    .Include(x => x.Tenant)
                                    .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                    .ToListAsync();

                return(new Response()
                {
                    Conversations = conversations.Select(x => ConversationApiModel.FromConversation(x)).ToList()
                });
            }