Beispiel #1
0
 public List <Ingredient> GetIngredients()
 {
     try
     {
         using (var ctx = new EntityRecipeAppDB())
         {
             List <Ingredient> ingredients = (
                 from a in ctx.Ingredients
                 select a
                 ).ToList();
             return(ingredients);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
 public List <Recipe> GetRecipes()
 {
     try
     {
         using (var ctx = new EntityRecipeAppDB())
         {
             List <Recipe> recipes = (
                 from a in ctx.Recipes
                 select a
                 ).ToList();
             return(recipes);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }