public override int GetHashCode() { unchecked { return((IngredientId.GetHashCode() * 397) ^ Grams.GetHashCode()); } }
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)); }
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; }