This commit is contained in:
@@ -239,7 +239,7 @@ namespace AyaNova.Api.Controllers
|
||||
});
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
|
||||
ct.SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ namespace AyaNova.Api.Controllers
|
||||
FileUtil.deleteFileAttachment(dbObj, ct);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDelete, dbObj.DisplayFileName), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDelete, dbObj.DisplayFileName), ct);
|
||||
ct.SaveChanges();
|
||||
return NoContent();
|
||||
}
|
||||
@@ -385,7 +385,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDownload, dbObj.DisplayFileName), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDownload, dbObj.DisplayFileName), ct);
|
||||
ct.SaveChanges();
|
||||
return PhysicalFile(filePath, mimetype, dbObj.DisplayFileName);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
var ret = AyaNova.Core.License.LicenseInfoAsJson;
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseFetch), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseFetch), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
return Ok(new ApiOkResponse(ret));
|
||||
@@ -180,7 +180,7 @@ namespace AyaNova.Api.Controllers
|
||||
var ret = Core.License.RequestTrial(requestData.EmailAddress, requestData.RegisteredTo, log);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseTrialRequest), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseTrialRequest), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
return Ok(new ApiOkResponse(ret));
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace AyaNova.Api.Controllers
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, o.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return CreatedAtAction("GetLocale", new { id = o.Id }, new ApiCreatedResponse(o));
|
||||
@@ -247,7 +247,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, oDbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, oDbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -317,7 +317,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, oFromDb.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace AyaNova.Api.Controllers
|
||||
string sResult = await GetTheMetrics("plain");
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return Content(sResult);
|
||||
@@ -100,7 +100,7 @@ namespace AyaNova.Api.Controllers
|
||||
JObject json = JObject.Parse(sResult);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return Ok(new ApiOkResponse(json));
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace AyaNova.Api.Controllers
|
||||
serverState.SetState(desiredState, state.Reason);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerState, AyaEvent.ServerStateChange, $"{state.ServerState}-{state.Reason}"), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerState, AyaEvent.ServerStateChange, $"{state.ServerState}-{state.Reason}"), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
return NoContent();
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace AyaNova.Api.Controllers
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.Tag, AyaEvent.Created), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, o.Id, AyaType.Tag, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return CreatedAtAction("GetTag", new { id = o.Id }, new ApiCreatedResponse(o));
|
||||
@@ -222,7 +222,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.Tag, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, oFromDb.Id, AyaType.Tag, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -294,7 +294,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.Tag, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, oFromDb.Id, AyaType.Tag, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -359,7 +359,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserId, id, AyaType.Tag, AyaEvent.TagMassUntag), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, id, AyaType.Tag, AyaEvent.TagMassUntag), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace AyaNova.Api.Controllers
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.TagGroup, AyaEvent.Created), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, o.Id, AyaType.TagGroup, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return CreatedAtAction("GetTagGroup", new { id = o.Id }, new ApiCreatedResponse(o));
|
||||
@@ -257,7 +257,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.TagGroup, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, oFromDb.Id, AyaType.TagGroup, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -329,7 +329,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.TagGroup, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, oFromDb.Id, AyaType.TagGroup, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace AyaNova.Api.Controllers
|
||||
JobsBiz.AddJob(j, ct);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, size), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, size), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace AyaNova.Api.Controllers
|
||||
try
|
||||
{
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, o.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
@@ -207,7 +207,7 @@ namespace AyaNova.Api.Controllers
|
||||
try
|
||||
{
|
||||
//Log
|
||||
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.userId, o.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
|
||||
Reference in New Issue
Block a user