public RecipeIngredientViewModel(RecipeIngredientViewModel other, int portion) { this._ingredient = other._ingredient; this._relation = new RecipeIngredientRelation { IngredientId = other.IngredientId, Quantity = other.Quantity * portion, Unit = other.Unit }; }
public RecipeIngredientViewModel(Ingredient ingredient, RecipeIngredientRelation relation) { if (ingredient.Id != relation.IngredientId) { throw new Exception("Invalid input parameters"); } this._ingredient = ingredient; this._relation = relation; }
public RecipeIngredientViewModel() { this._ingredient = new Ingredient(); this._relation = new RecipeIngredientRelation(); }