This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user