Automatically maps all unique constraints defined on a class using a the appropriate attributes (e.g. AutoMapUniqueConstraintAttribute) via reflection.
        /// <summary>
        /// Automaps all the unique constrainst for the ClassType defined by the <paramref name="classDef"/> using reflection
        /// </summary>
        /// <param name="classDef"></param>
        /// <returns></returns>
        public static IList<IKeyDef> MapUniqueConstraints(this IClassDef classDef)
        {
            if (classDef == null) return new List<IKeyDef>();
            UniqueConstraintAutoMapper autoMapper = new UniqueConstraintAutoMapper(classDef);

            return autoMapper.MapUniqueConstraints();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Automaps all the unique constrainst for the ClassType defined by the <paramref name="classDef"/> using reflection
        /// </summary>
        /// <param name="classDef"></param>
        /// <returns></returns>
        public static IList <IKeyDef> MapUniqueConstraints(this IClassDef classDef)
        {
            if (classDef == null)
            {
                return(new List <IKeyDef>());
            }
            UniqueConstraintAutoMapper autoMapper = new UniqueConstraintAutoMapper(classDef);

            return(autoMapper.MapUniqueConstraints());
        }