0

I have a model which contains a large amount of properties. I've been looking at examples on how to do an update on a row but they all have to assign every property at a time. Is there a better way, i.e. loop through the model.

In my edit action I get an instance of the row I want to update and I pass the model with the changes. What I don't want to do is have to add every property and was hoping I could just for loop through and then do the update to the database at the end.

Many thanks for any help,

  • Maybe you could try to use [AutoMapper](http://automapper.org/).You could refer to this [post](https://stackoverflow.com/a/59495347/10158551) or this [post](https://stackoverflow.com/questions/40275195/how-to-set-up-automapper-in-asp-net-core) – Ryan Jun 23 '21 at 08:56

0 Answers0