Exemplo n.º 1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         ConfigurationItemKey = ConfigurationItemKeyApiModel.FromConfigurationItemKey(await _context.ConfigurationItemKeys
                                                                                      .Include(x => x.Tenant)
                                                                                      .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
            public async Task <Response> Handle(Request request)
            {
                var configurationItemKeys = await _context.ConfigurationItemKeys
                                            .Include(x => x.Tenant)
                                            .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                            .ToListAsync();

                return(new Response()
                {
                    ConfigurationItemKeys = configurationItemKeys.Select(x => ConfigurationItemKeyApiModel.FromConfigurationItemKey(x)).ToList()
                });
            }