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