case 4322
This commit is contained in:
@@ -867,16 +867,16 @@ namespace AyaNova.Biz
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
||||
|
||||
|
||||
//If name is otherwise OK, check that name is unique
|
||||
if (!PropertyHasErrors("Name"))
|
||||
{
|
||||
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
|
||||
if (await ct.User.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
||||
}
|
||||
}
|
||||
//case 4322 this is a problem with customer contacts and not really required anyway
|
||||
// //If name is otherwise OK, check that name is unique
|
||||
// if (!PropertyHasErrors("Name"))
|
||||
// {
|
||||
// //Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
|
||||
// if (await ct.User.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
|
||||
// {
|
||||
// AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
||||
// }
|
||||
// }
|
||||
|
||||
//LOGIN must be unique
|
||||
if (await ct.User.AnyAsync(z => z.Login == proposedObj.Login && z.Id != proposedObj.Id))
|
||||
|
||||
Reference in New Issue
Block a user