Пример #1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Tile = TileApiModel.FromTile(await _context.Tiles
                                      .Include(x => x.Tenant)
                                      .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
            public async Task <Response> Handle(Request request)
            {
                var tiles = await _context.Tiles
                            .Include(x => x.Tenant)
                            .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                            .ToListAsync();

                return(new Response()
                {
                    Tiles = tiles.Select(x => TileApiModel.FromTile(x)).ToList()
                });
            }