public void UpdateProductVarient(ProductVarient varient) { var oldVarient = GetProductVarient(varient.Id); oldVarient.Name = varient.Name; oldVarient.Description = varient.Description; oldVarient.ProductId = varient.ProductId; varientRepo.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the ProductVarients EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToProductVarients(ProductVarient productVarient) { base.AddObject("ProductVarients", productVarient); }
public static ProductVarientModel FromDomainModel(ProductVarient varient) { return new ProductVarientModel { Id = varient.Id, Name = varient.Name, Description = varient.Description, Product = varient.Product.Name }; }
/// <summary> /// Create a new ProductVarient object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="productId">Initial value of the ProductId property.</param> /// <param name="objectInfo">Initial value of the ObjectInfo property.</param> public static ProductVarient CreateProductVarient(global::System.Int32 id, global::System.String name, global::System.Int32 productId, ObjectInfo objectInfo) { ProductVarient productVarient = new ProductVarient(); productVarient.Id = id; productVarient.Name = name; productVarient.ProductId = productId; productVarient.ObjectInfo = StructuralObject.VerifyComplexObjectIsNotNull(objectInfo, "ObjectInfo"); return productVarient; }