Exemplo n.º 1
0
        public PagedResult <BeerRepresentation> Execute(IBeerDbContext dbContext, int skip, int take)
        {
            var beers = dbContext
                        .Beers
                        .Where(where)
                        .OrderBy(b => b.Name)
                        .Skip(skip)
                        .Take(take)
                        .Select(b => new BeerRepresentation
            {
                Id          = b.Id,
                Name        = b.Name,
                BreweryId   = b.Brewery.Id,
                BreweryName = b.Brewery.Name,
                StyleId     = b.Style.Id,
                StyleName   = b.Style.Name
            })
                        .ToList();

            var count = dbContext.Beers
                        .Where(where)
                        .Count();

            return(new PagedResult <BeerRepresentation>(beers, count, skip, take));
        }
Exemplo n.º 2
0
 public StylesController(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 3
0
 public BreweriesController(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 4
0
 public BreweriesController(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 5
0
 public BeerController(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 6
0
 public BeerController(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 7
0
 public BeerRepository(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 8
0
 public BeerController(IBeerDbContext beerDbContext, JsonOutputFormatter outputFormatter)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 9
0
 public StylesController(IBeerDbContext beerDbContext, IRepository repository)
 {
     this.beerDbContext = beerDbContext;
     this.repository = repository;
 }
Exemplo n.º 10
0
 public StylesController(IBeerDbContext beerDbContext)
 {
     this.beerDbContext = beerDbContext;
 }
Exemplo n.º 11
0
 public BeersController(IBeerDbContext beerDbContext, IRepository repository)
 {
     this.beerDbContext = beerDbContext;
     this.repository    = repository;
 }