This commit is contained in:
2020-01-27 18:20:30 +00:00
parent e80f24c419
commit 85b7a38255

View File

@@ -297,7 +297,7 @@ namespace AyaNova.Biz
// //
//Can save or update? //Can save or update?
private void Validate(string inObjName, bool isNew) private async Task Validate(string inObjName, bool isNew)
{ {
//run validation and biz rules //run validation and biz rules
@@ -310,7 +310,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 char max"); AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 char max");
//Name must be unique //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"); AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
return; return;