diff --git a/server/AyaNova/biz/LocaleBiz.cs b/server/AyaNova/biz/LocaleBiz.cs index c730edfa..0d9eabe9 100644 --- a/server/AyaNova/biz/LocaleBiz.cs +++ b/server/AyaNova/biz/LocaleBiz.cs @@ -297,7 +297,7 @@ namespace AyaNova.Biz // //Can save or update? - private void Validate(string inObjName, bool isNew) + private async Task Validate(string inObjName, bool isNew) { //run validation and biz rules @@ -310,7 +310,7 @@ namespace AyaNova.Biz AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 char max"); //Name must be unique - if (ct.Locale.Where(m => m.Name == inObjName).FirstOrDefault() != null) + if( await ct.Locale.AnyAsync(m => m.Name == inObjName)) AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name"); return;