public void Create(Recipe recipe) { if (recipe != null) { Context.Recipes.Add(recipe); } }
public bool InCategory(Recipe recipe, RecipeCategory category) { if (recipe == null || category == null) { return false; } return recipe.CategoryId == category.Id; }
public void AddToCategory(Recipe recipe, RecipeCategory category) { recipe.RecipeCategory = category; category.Recipes.Add(recipe); }
public void Update(Recipe recipe) { Context.Entry(recipe).State = EntityState.Modified; }