public void AddLocation(Recipe recipe, Location location)
        {
            var existing = Access.RecipeLocations.SingleOrDefault(x => x.Recipe == recipe && x.Location == location);

            if (existing != null)
            {
                throw new RecipeLocationAlreadyExistsError();
            }

            var recipeLocation = new RecipeLocation {
                Recipe = recipe, Location = location
            };

            Access.AddRecipeLocation(recipeLocation);
        }
Beispiel #2
0
 public void AddRecipeLocation(RecipeLocation recipeLocation)
 {
     Context.RecipeLocations.Add(recipeLocation);
 }