public int GetHashCode(ProductAllergen obj) { if (Object.ReferenceEquals(obj, null)) { return(0); } int hashProductCode = obj.AllergenId.GetHashCode(); return(hashProductCode); }
public bool Equals(ProductAllergen x, ProductAllergen y) { if (Object.ReferenceEquals(x, y)) { return(true); } if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) { return(false); } return(x.AllergenId == y.AllergenId); }
///***Allergens Actions***/// public void AddAllergenToProduct(ProductAllergen productAllergen) { _context.ProductAllergens.Add(productAllergen); _context.SaveChanges(); }
public void RemoveAllergenFromProduct(ProductAllergen productAllergenToBeRemoved) { _context.ProductAllergens.Remove(productAllergenToBeRemoved); _context.SaveChanges(); }