Based on the code you've posted, it won't do anything at all. There's no code to update the database from the posted data, so the database won't be updated.
You'll need to start by retrieving the corresponding entity from the database:
var entity = db.YourSet.Find(model.PrimaryKey);
if (entity == null) return RedirectToAction("Index");
You'll then need to copy the values from the posted data. You can either do that manually:
entity.Prop1 = model.Prop1;
entity.Prop2 = model.Prop2;
...
Or you can use the
TryUpdateModel[
^] method. But you'll want to explicitly state which properties can be updated, to prevent a malicious user from overwriting things that shouldn't be changed:
TryUpdateModel(entity, new[] { "Prop1", "Prop2", ... });
Once you've done that,
then you can save the changes:
db.SaveChanges();
return View(model);
If you don't copy a property from the posted data, or don't include it in the list of included properties, then the database value will not be changed.
If you copy / include the property, but the user didn't enter a value, then the database value will be cleared. If the property is required, you'll get a validation error when you try to save. Otherwise, the value in the database will be overwritten.