protected override void UpdateValidate(RuleTemplate obj) { GeneralValidation(obj); RuleRepository ruleRepository = new RuleRepository(); UIValidationExceptions exception = new UIValidationExceptions(); //if (_ruleRep.GetAll().Any(x => x.ID != obj.ID && x.Name.ToUpper().Equals(obj.Name.ToUpper()))) if (ruleRepository.GetCountByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => obj.Name), obj.Name)) > 0) { exception.Add(ExceptionResourceKeys.BRuleCodeRepeated, "نام تكراري است", ExceptionSrc); } //if (_ruleRep.GetAll().Any(x => x.ID != obj.ID && x.IdentifierCode.Equals(obj.IdentifierCode))) if (ruleRepository.GetCountByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => obj.IdentifierCode), obj.IdentifierCode)) > 0) { exception.Add(ExceptionResourceKeys.BRuleCodeRepeated, "كد تكراري است", ExceptionSrc); } if (exception.Count > 0) { throw exception; } }