Example #1
0
 public async Task <CookBook> GetUserCookBookWithEagerLoadedObjectsAsyncByName(string userId, string cookBookName)
 {
     return(EntitySorter.SortRecipesInCookBook(await context
                                               .CookBooks
                                               .Where(n => n.CookBookName == cookBookName && n.OwnerId == userId)
                                               .Include(r => r.Recipes)
                                               .Include(o => o.Owner)
                                               .SingleAsync()));
 }
Example #2
0
 public async Task <CookBook> GetCookBookWithEagerLoadedObjectsAsync(int id)
 {
     return(EntitySorter.SortRecipesInCookBook(await context
                                               .CookBooks
                                               .Where(i => i.CookBookId == id)
                                               .Include(r => r.Recipes)
                                               .Include(o => o.Owner)
                                               .SingleAsync()));
 }