示例#1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((IngredientId.GetHashCode() * 397) ^ Grams.GetHashCode());
     }
 }
示例#2
0
 public bool Equals(RecipeIngredient other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(IngredientId.Equals(other.IngredientId) && Grams.Equals(other.Grams));
 }
示例#3
0
 public Ingredient(string name, string description)
 {
     Id = new IngredientId();
     Name = name;
     Description = description;
 }
 public MealIngredient(IngredientId ingredient, Quantity quantity, string preparation = null)
 {
     Ingredient  = ingredient ?? throw new ArgumentNullException(nameof(ingredient));
     Quantity    = quantity;
     Preparation = preparation;
 }