I am getting the value which I needed in the HttpPost of edit action method, the error arise only when saving it to the db
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Edit( StudentDetail studentDetail )
{
if (ModelState.IsValid)
{
studentDetail .CashInHand -= studentDetail .CashReceived;
studentDetail .Amount += studentDetail .CashReceived;
studentDetail .Date = DateTime.Now;
studentDetail .cashReceived = null;
db.Entry(studentDetail ).State = EntityState.Modified;
await db.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(studentDetail );
}
I am getting details in studentDetail. Then Why is that the error showing ???can anyone please help me to find the solution ??