public void Update(string name, string description, RecipeInfo info, IEnumerable <RecipeIngredient> ingredients) { Name = SetName(name); Description = SetDescription(description); RecipeInfo = info; RecipeIngredients = new RecipeIngredientsCollection(ingredients); Update(); }
public async Task <Recipe> Create(Guid id, string name, string description, string imageUrl, RecipeInfo recipeInfo, IEnumerable <RecipeIngredient> recipeIngredients) { var recipe = GetRecipe(id, name, description, imageUrl, recipeInfo, recipeIngredients); await recipe.Create(); return(recipe); }
private Recipe(Identity <Guid> id, string name, string description, string imageUrl, RecipeInfo recipeInfo, IEnumerable <RecipeIngredient> recipeIngredients, IEventPublisher eventPublisher, IRecipeRepository recipeRepository) { Id = id; Name = SetName(name); Description = SetDescription(description); ImageUrl = imageUrl; RecipeInfo = recipeInfo; RecipeIngredients = new RecipeIngredientsCollection(recipeIngredients); _eventPublisher = eventPublisher; _recipeRepository = recipeRepository; }
public Recipe GetRecipe(Guid id, string name, string description, string imageUrl, RecipeInfo recipeInfo, IEnumerable <RecipeIngredient> recipeIngredients) { var recipeId = new Identity <Guid>(id); var recipe = new Recipe(recipeId, name, description, imageUrl, recipeInfo, recipeIngredients, _eventPublisher, _recipeRepository); return(recipe); }
public static RecipeInfo FromDomainRecipeInfo(Domain.Recipes.Entities.RecipeInfo recipeInfo) => new RecipeInfo(recipeInfo.DifficultyLevel, recipeInfo.PreparationTime, recipeInfo.ApproximateCost, recipeInfo.Servings, recipeInfo.MealTypes);