First case - asp.net session lock
If you use asp.net forms and the session of asp.net, then the session is lock the entire call for all users, so you don't need to extra take care to synchronize that.
Relative questions :
Does ASP.NET Web Forms prevent a double click submission?
Trying to make Web Method Asynchronous
Web app blocked while processing another web app on sharing same session
What perfmon counters are useful for identifying ASP.NET bottlenecks?
Replacing ASP.Net's session entirely
Second case - the local thread.
If you not use the asp.net session, or if you open extra threads on the same call, then you need to lock the manipulation of static data.
public class BusinessClass
{
private static readonly object oLock = new object();
static BusinessClass myClass { get; set; } = null;
Repository repo;
public BusinessClass()
{
if (repo == null)
repo = new RepositoryClass();
}
public static BusinessClass Instance
{
get
{
if myClass == null)
{
lock (oLock)
{
if myClass == null)
myClass = new BusinessClass();
}
}
return myClass
}
}
public void Update(Entity Item)
{
repo.Update(Item);
}
}
Final case - the global change
If you wish to double check a global change on the database or on the files, or on anything that can change from simulate edit of the system - on a web platform that runs on web garden (multi pools for the same site)... and ignore the session...
Then you need mutex to synchronize all calls.
By using mutex, you also need to check just before the update, that the record is still the same and if not you signaling that some one else change it and the current user will overwrite it.
More to consider - multi-user environment.
Think this scenario.
User A and B, load the same page, the same data, and each of one change them.
the users are going to save each data - not the same moment - but with a lot of time different. The data that you write down is the last one saved. One of the user will lost their changes.
So you need some more to consider and made a lot more synchronization signaling in a multi user environment if your users update the same data - beyond the locking system.