Exemple #1
0
        public bool DuplicationChecking(TermStyle entity, string name)
        {
            var example = Activator.CreateInstance(entity.GetType()).As <TermStyle>();

            example.Name = name;
            var count = _termStyleRepository.Count(example);

            return(0 < count);
        }
Exemple #2
0
        public bool DuplicationChecking(Entity entity, string name)
        {
            var example = Activator.CreateInstance(entity.GetType()).As <TermStyle>();

            example.Name = name;
            var count = _termStyleRepository.Count(example);

            if (entity.IsNew())
            {
                return(0 < count);
            }
            else
            {
                if (entity.Name == name && 1 == count)
                {
                    return(false);
                }
                return(0 < count);
            }
        }