Exemplo n.º 1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ProductSize EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProductSize(ProductSize productSize)
 {
     base.AddObject("ProductSize", productSize);
 }
Exemplo n.º 2
0
 public ActionResult AddProductSize(int productId, FormCollection form)
 {
     using (var context = new SiteContainer())
     {
         var product = context.Product.First(c => c.Id == productId);
         var ps = new ProductSize();
         TryUpdateModel(ps, new[] { "Size" });
         product.ProductSizes.Add(ps);
         context.SaveChanges();
         return RedirectToAction("ProductDetails", "Home", new { area = "", id = productId });
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new ProductSize object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="size">Initial value of the Size property.</param>
 /// <param name="productId">Initial value of the ProductId property.</param>
 public static ProductSize CreateProductSize(global::System.Int32 id, global::System.String size, global::System.Int32 productId)
 {
     ProductSize productSize = new ProductSize();
     productSize.Id = id;
     productSize.Size = size;
     productSize.ProductId = productId;
     return productSize;
 }