I found this solution on the internet:
private static readonly object SyncLock = new object();
if (context.IsInTransaction)
{
lock (SyncLock)
{
GenerateAutoNumber(entity, service);
}
}
can i rely on it ? or not ?
if not, why ?
Thank you
I found this solution on the internet:
private static readonly object SyncLock = new object();
if (context.IsInTransaction)
{
lock (SyncLock)
{
GenerateAutoNumber(entity, service);
}
}
can i rely on it ? or not ?
if not, why ?
Thank you
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,466 Most Valuable Professional
nmaenpaa 101,156