我正在用mvc4和实体框架5编写一个非常小的应用程序.
我想为产品添加产品,商店和图像.
我有一个模特
[Table("CatalogItem")]
public class CatalogItemModel
{
[Key]
public int CatalogItemId { get; set; }
public string Description { get; set; }
public double Price { get; set; }
public int ProductCount { get; set; }
public string Size { get; set; }
public string Sku { get; set; }
[Column(TypeName = "image")]
public byte[] Image { get; set; }
[Display(Name = "Display Catalog Item")]
public bool DisplayItem { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我的控制器.这永远不会受到打击.
[HttpPost]
public ActionResult Create(CatalogItemModel catalogitemmodel) …Run Code Online (Sandbox Code Playgroud)