Example #1
0
 public void UpdateProductVarient(ProductVarient varient)
 {
     var oldVarient = GetProductVarient(varient.Id);
     oldVarient.Name = varient.Name;
     oldVarient.Description = varient.Description;
     oldVarient.ProductId = varient.ProductId;
     varientRepo.SaveChanges();
 }
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ProductVarients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProductVarients(ProductVarient productVarient)
 {
     base.AddObject("ProductVarients", productVarient);
 }
Example #3
0
 public static ProductVarientModel FromDomainModel(ProductVarient varient)
 {
     return new ProductVarientModel {
         Id = varient.Id,
         Name = varient.Name,
         Description = varient.Description,
         Product = varient.Product.Name
     };
 }
Example #4
0
 /// <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;
 }