Today in interview I got asked this kind of question.
Let’s say you want to update multiple records same time using web api then how you can do that.
As it is around 1000s of records for updating..
So I give reply to use async and await for now.
Then he ask me if user 1 update record and same time user 2 update record so which will take action and how this scenario can handle.
So what should be best reply for this kind of question.
If user 1 update record and same time user 2 update record so which will take action and how this scenario can handle?
"concurrency", To handle this kind so scneario you have to use
for handling concurrency
(updating same record from different user)so that user may understand that other
user is modifying this as well.
Asp.net Entity Framework Aspect:
asp.net Entity framework has
RowVersion property which will track update log for a specific data
when it’s been updated.
Two kind of Concurrency Mechanism you can use:
From database you can also handle this scenario. All the database also
Locking mechanismto work on same records simultaneously by
multipole user. You can have a look here
Hope it will guide you accordingly and redeem your confusion.