예제 #1
0
        public Brewery GetById(long id)
        {
            Brewery brewery = breweryContext.Breweries.Find(id);

            if (brewery == null)
            {
                return(null);
            }

            breweryContext.Entry(brewery).Collection(x => x.Beers).Query()
            .Include(x => x.BeerProviders)
            .ThenInclude(x => x.Provider)
            .Load();
            return(brewery);
        }
예제 #2
0
        public bool Exists(long id)
        {
            Brewery brewery = breweryContext.Breweries.Find(id);

            return(brewery != null);
        }