public Error Satisfy(DomainEntity domainEntity)
 {
     if (_repo.HasSimilar(domainEntity))
     {
         return(new Error($"{_dictionary.Translate(domainEntity.GetType().Name)} already exists."));
     }
     return(Error.Empty);
 }
 public override bool Equals(DomainEntity other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (other.GetType() != GetType())
     {
         return(false);
     }
     return(Equals((EqualityTesterEntity)other));
 }
        public Error Satisfy(DomainEntity domainEntity)
        {
            var property = domainEntity.GetType().GetProperty(_propertyName);

            if (property.PropertyType == typeof(string))
            {
                if (StringCheck(domainEntity, property))
                {
                    return(CreateError());
                }
                else
                {
                    return(Error.Empty);
                }
            }
            if (DomainEntityCheck(domainEntity, property))
            {
                return(CreateError());
            }
            return(Error.Empty);
        }