I seem to be missing something obvious. I'm using Bind in my edit method to update only the fields listed in Bind. However, all fields are being updated, and becuase many fields aren't included in the form post, those fields are overwritten and set to null. I want to only update the fields listed in Bind.
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Edit([Bind(Include = "customerid,firstname,lastname,businessid,userid")] customers customers)
{
if (ModelState.IsValid)
{
db.Entry(customers).State = EntityState.Modified;
await db.SaveChangesAsync();
return RedirectToAction("Index");
}
...
}