This commit is contained in:
2020-05-22 13:28:39 +00:00
parent 30fb7475d8
commit ef99cc404e
3 changed files with 23 additions and 4 deletions

View File

@@ -74,10 +74,20 @@ namespace AyaNova.Biz
Validate(dbObject);
if (HasErrors)
return null;
await ct.SaveChangesAsync();
try
{
await ct.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
return null;
}
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 1, BizType, AyaEvent.Modified), ct);
//Update the static copy for the server
ServerGlobalOpsSettingsCache.Backup=dbObject;
ServerGlobalOpsSettingsCache.Backup = dbObject;
return dbObject;
}