Is there any possible way we can convert it? I pretty much ran out of ideas on how to do it. Any help will be much appreciated. Thanks!
[System.Web.Mvc.HttpPost]
public ActionResult addItem()
{
var tae = Request.Form[0];
var ctx = new Models.CangsODEntities4();
Models.Item item = Newtonsoft.Json.JsonConvert.DeserializeObject<Models.Item>(tae);
ctx.Items.Add(item);
ctx.SaveChanges();
Response.StatusCode = 200;
return Content(item.itemID.ToString());
}
This is my POST method for adding an item.
public int itemID { get; set; }
public string itemName { get; set; }
public int itemQuantityStored { get; set; }
public decimal itemPrice { get; set; }
public int purchaseCount { get; set; }
public byte[] picture { get; set; }
public int isDeleted { get; set; }
This is how my Models.Item looks like.