This commit is contained in:
2018-10-08 18:20:10 +00:00
parent f6c9280a11
commit 40dc278310
15 changed files with 96 additions and 119 deletions

View File

@@ -183,13 +183,6 @@ namespace AyaNova.Api.Controllers
}
else
{
//save to get Id
await ct.SaveChangesAsync();
//Log
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));
}
}
@@ -241,17 +234,12 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
LocaleBiz biz = new LocaleBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent))
{
return BadRequest(new ApiErrorResponse(biz.Errors));
}
//Log
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, oDbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
try
{
await ct.SaveChangesAsync();
if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent))
{
return BadRequest(new ApiErrorResponse(biz.Errors));
}
}
catch (DbUpdateConcurrencyException)
{
@@ -311,17 +299,13 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
LocaleBiz biz = new LocaleBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
if (!biz.PutLocaleName(oFromDb, inObj))
{
return BadRequest(new ApiErrorResponse(biz.Errors));
}
//Log
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, oFromDb.Id, AyaType.Locale, AyaEvent.Modified), ct);
try
{
await ct.SaveChangesAsync();
if (!biz.PutLocaleName(oFromDb, inObj))
{
return BadRequest(new ApiErrorResponse(biz.Errors));
}
}
catch (DbUpdateConcurrencyException)
{