Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }