I did updating my data using NuGet Microsoft.EntityFrameworkCore and success, but the Id data is changed. How i could update data without change the Id data?
this picture before i'm update the data :
and this after i'm update the data:
this my controller code :
public IActionResult Edit(int? Id)
{
var DataCustomer = _conn.tabel_customer.Where(c => c.CustomerId == Id).FirstOrDefault();
return View(DataCustomer);
}
[HttpPost]
public IActionResult Edit(Customer customer)
{
_conn.Update(customer);
_conn.SaveChanges();
TempData["Message"] = "The Record " customer.Name " Is Changed Successfully