diff --git a/server/AyaNova/Controllers/ApiRootController.cs b/server/AyaNova/Controllers/ApiRootController.cs index 499eff36..4f2543d1 100644 --- a/server/AyaNova/Controllers/ApiRootController.cs +++ b/server/AyaNova/Controllers/ApiRootController.cs @@ -62,7 +62,7 @@ namespace AyaNova.Api.Controllers AyaNova manual

API explorer

Email AyaNova support

-

{LocaleBiz.GetDefaultLocalizedText("HelpLicense").Result}

+

{LocaleBiz.GetDefaultLocalizedTextAsync("HelpLicense").Result}

{AyaNova.Core.License.LicenseInfo}

Schema version

{AySchema.currentSchema.ToString()}
diff --git a/server/AyaNova/Controllers/AyaEnumPickListController.cs b/server/AyaNova/Controllers/AyaEnumPickListController.cs index 17b91dea..f2b49316 100644 --- a/server/AyaNova/Controllers/AyaEnumPickListController.cs +++ b/server/AyaNova/Controllers/AyaEnumPickListController.cs @@ -82,7 +82,7 @@ namespace AyaNova.Api.Controllers LocaleKeysToFetch.Add("UserTypesClient"); LocaleKeysToFetch.Add("UserTypesHeadOffice"); LocaleKeysToFetch.Add("UserTypesSubContractor"); - var LT = LocaleBiz.GetSubsetStatic(LocaleKeysToFetch, LocaleId).Result; + var LT = LocaleBiz.GetSubsetStaticAsync(LocaleKeysToFetch, LocaleId).Result; ReturnList.Add(new NameIdItem() { Name = LT["UserTypesAdministrator"], Id = (long)UserType.Administrator }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypesSchedulable"], Id = (long)UserType.Schedulable }); @@ -115,7 +115,7 @@ namespace AyaNova.Api.Controllers LocaleKeysToFetch.Add("AuthorizationRoleSalesLimited"); LocaleKeysToFetch.Add("AuthorizationRoleSalesFull"); LocaleKeysToFetch.Add("AuthorizationRoleAll"); - var LT = LocaleBiz.GetSubsetStatic(LocaleKeysToFetch, LocaleId).Result; + var LT = LocaleBiz.GetSubsetStaticAsync(LocaleKeysToFetch, LocaleId).Result; ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleNoRole"], Id = (long)AuthorizationRoles.NoRole }); ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleBizAdminLimited"], Id = (long)AuthorizationRoles.BizAdminLimited }); diff --git a/server/AyaNova/Controllers/EventLogController.cs b/server/AyaNova/Controllers/EventLogController.cs index fe51943a..21ac7007 100644 --- a/server/AyaNova/Controllers/EventLogController.cs +++ b/server/AyaNova/Controllers/EventLogController.cs @@ -66,7 +66,7 @@ namespace AyaNova.Api.Controllers return StatusCode(403, new ApiNotAuthorizedResponse()); } - var result = await EventLogProcessor.GetLogForObject(opt, ct); + var result = await EventLogProcessor.GetLogForObjectAsync(opt, ct); return Ok(ApiOkResponse.Response(result, true)); } @@ -101,7 +101,7 @@ namespace AyaNova.Api.Controllers return StatusCode(403, new ApiNotAuthorizedResponse()); } - var result = await EventLogProcessor.GetLogForUser(opt, ct); + var result = await EventLogProcessor.GetLogForUserAsync(opt, ct); return Ok(ApiOkResponse.Response(result, true)); } diff --git a/server/AyaNova/Controllers/LocaleController.cs b/server/AyaNova/Controllers/LocaleController.cs index c861a8b1..dc72e23f 100644 --- a/server/AyaNova/Controllers/LocaleController.cs +++ b/server/AyaNova/Controllers/LocaleController.cs @@ -149,7 +149,7 @@ namespace AyaNova.Api.Controllers //Instantiate the business object handler LocaleBiz biz = LocaleBiz.GetBiz(ct, HttpContext); - var l = await biz.GetSubset(inObj); + var l = await biz.GetSubsetAsync(inObj); return Ok(ApiOkResponse.Response(l, true)); } @@ -231,7 +231,7 @@ namespace AyaNova.Api.Controllers try { - if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent)) + if (!biz.PutLocaleItemDisplayTextAsync(oFromDb, inObj, oDbParent)) { return BadRequest(new ApiErrorResponse(biz.Errors)); } @@ -293,7 +293,7 @@ namespace AyaNova.Api.Controllers try { - if (!biz.PutLocaleName(oFromDb, inObj)) + if (!biz.PutLocaleNameAsync(oFromDb, inObj)) { return BadRequest(new ApiErrorResponse(biz.Errors)); } diff --git a/server/AyaNova/biz/EventLogProcessor.cs b/server/AyaNova/biz/EventLogProcessor.cs index a2ad8637..71b19b0c 100644 --- a/server/AyaNova/biz/EventLogProcessor.cs +++ b/server/AyaNova/biz/EventLogProcessor.cs @@ -44,7 +44,7 @@ namespace AyaNova.Biz /// Get the event log for a specified object /// Presentation is the client's responsibility (localization internationalization etc) /// - internal static async Task GetLogForObject(AyaNova.Api.Controllers.EventLogController.EventLogOptions opt, AyContext ct) + internal static async Task GetLogForObjectAsync(AyaNova.Api.Controllers.EventLogController.EventLogOptions opt, AyContext ct) { //This is also an example of conditional where statements @@ -82,7 +82,7 @@ namespace AyaNova.Biz /// Get the event log for a specified User /// Presentation is the client's responsibility (localization internationalization etc) /// - internal static async Task GetLogForUser(AyaNova.Api.Controllers.EventLogController.EventLogOptions opt, AyContext ct) + internal static async Task GetLogForUserAsync(AyaNova.Api.Controllers.EventLogController.EventLogOptions opt, AyContext ct) { //Set up the query var q = ct.Event.Select(m => m); diff --git a/server/AyaNova/biz/ImportAyaNova7Biz.cs b/server/AyaNova/biz/ImportAyaNova7Biz.cs index 115b04f9..4fb00236 100644 --- a/server/AyaNova/biz/ImportAyaNova7Biz.cs +++ b/server/AyaNova/biz/ImportAyaNova7Biz.cs @@ -149,16 +149,16 @@ namespace AyaNova.Biz // //USERS - await DoImport("GZTW.AyaNova.BLL.User", "main", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists); + await DoImportAsync("GZTW.AyaNova.BLL.User", "main", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists); //Now can do event log entries - await DoImport("GZTW.AyaNova.BLL.User", "eventlog", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists); + await DoImportAsync("GZTW.AyaNova.BLL.User", "eventlog", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists); //IMPORT LOCALES - await DoImport("GZTW.AyaNova.BLL.Locale", "main", AyaType.Locale, job.GId, importMap, importFileName, zipEntries, TagLists); + await DoImportAsync("GZTW.AyaNova.BLL.Locale", "main", AyaType.Locale, job.GId, importMap, importFileName, zipEntries, TagLists); //Now can do user locale settings properly - await DoImport("GZTW.AyaNova.BLL.User", "locale", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists); + await DoImportAsync("GZTW.AyaNova.BLL.User", "locale", AyaType.User, job.GId, importMap, importFileName, zipEntries, TagLists); //TODO: CLIENT //do import for client here @@ -194,7 +194,7 @@ namespace AyaNova.Biz /// /// /// - private async Task DoImport(string entryStartsWith, string importTask, AyaType importerType, Guid jobId, + private async Task DoImportAsync(string entryStartsWith, string importTask, AyaType importerType, Guid jobId, List importMap, string importFileName, List zipEntries, Dictionary> tagLists) { var zipObjectList = zipEntries.Where(m => m.StartsWith(entryStartsWith)).ToList(); diff --git a/server/AyaNova/biz/LocaleBiz.cs b/server/AyaNova/biz/LocaleBiz.cs index 2f8878d8..c730edfa 100644 --- a/server/AyaNova/biz/LocaleBiz.cs +++ b/server/AyaNova/biz/LocaleBiz.cs @@ -154,7 +154,7 @@ namespace AyaNova.Biz #endif //Get the keys for a list of keys provided - internal async Task>> GetSubset(List param) + internal async Task>> GetSubsetAsync(List param) { #if (DEBUG) @@ -165,7 +165,7 @@ namespace AyaNova.Biz } //Get the keys for a list of keys provided, static format for calling from other internal classes - internal static async Task> GetSubsetStatic(List param, long localeId) + internal static async Task> GetSubsetStaticAsync(List param, long localeId) { #if (DEBUG) TrackRequestedKey(param); @@ -179,7 +179,7 @@ namespace AyaNova.Biz //Get the CJKIndex value for the locale specified - internal static async Task GetCJKIndex(long localeId, AyContext ct = null) + internal static async Task GetCJKIndexAsync(long localeId, AyContext ct = null) { if (ct == null) ct = ServiceProviderProvider.DBContext; @@ -193,7 +193,7 @@ namespace AyaNova.Biz /// /// /// - internal static async Task GetDefaultLocalizedText(string key) + internal static async Task GetDefaultLocalizedTextAsync(string key) { if (string.IsNullOrWhiteSpace(key)) return "ERROR: GetDefaultLocalizedText NO KEY VALUE SPECIFIED"; @@ -217,7 +217,7 @@ namespace AyaNova.Biz // - internal bool PutLocaleItemDisplayText(LocaleItem dbObj, NewTextIdConcurrencyTokenItem inObj, Locale dbParent) + internal async Task PutLocaleItemDisplayTextAsync(LocaleItem dbObj, NewTextIdConcurrencyTokenItem inObj, Locale dbParent) { if (dbParent.Stock == true) @@ -239,16 +239,16 @@ namespace AyaNova.Biz if (HasErrors) return false; - ct.SaveChanges(); + await ct.SaveChangesAsync(); //Log - EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbParent.Id, AyaType.Locale, AyaEvent.Modified), ct); + await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbParent.Id, AyaType.Locale, AyaEvent.Modified), ct); return true; } - internal bool PutLocaleName(Locale dbObj, NewTextIdConcurrencyTokenItem inObj) + internal async Task PutLocaleNameAsync(Locale dbObj, NewTextIdConcurrencyTokenItem inObj) { if (dbObj.Stock == true) { @@ -267,9 +267,9 @@ namespace AyaNova.Biz if (HasErrors) return false; - ct.SaveChanges(); + await ct.SaveChangesAsync(); //Log - EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObj.Id, AyaType.Locale, AyaEvent.Modified), ct); + await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObj.Id, AyaType.Locale, AyaEvent.Modified), ct); return true; } @@ -587,7 +587,7 @@ namespace AyaNova.Biz { if (!NewLocaleDict.ContainsKey(s)) { - NewLocaleDict.Add(s, GetDefaultLocalizedText(s).Result); + NewLocaleDict.Add(s, GetDefaultLocalizedTextAsync(s).Result); } } diff --git a/server/AyaNova/biz/Search.cs b/server/AyaNova/biz/Search.cs index 67b549d4..f72f69b9 100644 --- a/server/AyaNova/biz/Search.cs +++ b/server/AyaNova/biz/Search.cs @@ -722,7 +722,7 @@ cache or provide directly the locale to save time repeatedly fetching it when do Param.Add("StopWords5"); Param.Add("StopWords6"); Param.Add("StopWords7"); - var Stops = LocaleBiz.GetSubsetStatic(Param, localeId).Result; + var Stops = LocaleBiz.GetSubsetStaticAsync(Param, localeId).Result; foreach (KeyValuePair kvp in Stops) { @@ -733,7 +733,7 @@ cache or provide directly the locale to save time repeatedly fetching it when do } } - LSD.CJKIndex = LocaleBiz.GetCJKIndex(localeId, ct).Result; + LSD.CJKIndex = LocaleBiz.GetCJKIndexAsync(localeId, ct).Result; return LSD; } diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 7d05f00a..6d523243 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -86,7 +86,7 @@ namespace AyaNova.Biz await ct.SaveChangesAsync(); //Handle child and associated items: await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct); - await SearchIndex(outObj, true); + await SearchIndexAsync(outObj, true); await TagUtil.ProcessUpdateTagsInRepositoryAsync(ct, outObj.Tags, null); return outObj; @@ -117,7 +117,7 @@ namespace AyaNova.Biz //Handle child and associated items: await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct); - await SearchIndex(outObj, true); + await SearchIndexAsync(outObj, true); await TagUtil.ProcessUpdateTagsInRepositoryAsync(ct, outObj.Tags, null); return outObj; @@ -152,7 +152,7 @@ namespace AyaNova.Biz //Log event and save context await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); - await SearchIndex(dbObj, false); + await SearchIndexAsync(dbObj, false); await TagUtil.ProcessUpdateTagsInRepositoryAsync(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags); return true; @@ -182,7 +182,7 @@ namespace AyaNova.Biz //Log event and save context await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); - await SearchIndex(dbObj, false); + await SearchIndexAsync(dbObj, false); await TagUtil.ProcessUpdateTagsInRepositoryAsync(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags); @@ -190,7 +190,7 @@ namespace AyaNova.Biz } - private async Task SearchIndex(Widget obj, bool isNew) + private async Task SearchIndexAsync(Widget obj, bool isNew) { //SEARCH INDEXING var SearchParams = new Search.SearchIndexProcessObjectParameters(UserLocaleId, obj.Id, BizType, obj.Name);