示例#1
0
        /// <summary>
        /// Generates a <see cref="ClassMap"/> for the type.
        /// </summary>
        /// <typeparam name="T">The type to generate the map for.</typeparam>
        /// <returns>The generate map.</returns>
        public virtual ClassMap <T> AutoMap <T>()
        {
            var map = ReflectionHelper.CreateInstance <DefaultClassMap <T> >();

            map.AutoMap(this);
            maps.Add(map);

            return(map);
        }
示例#2
0
        /// <summary>
        /// Generates a <see cref="ClassMap"/> for the type.
        /// </summary>
        /// <param name="type">The type to generate for the map.</param>
        /// <returns>The generate map.</returns>
        public virtual ClassMap AutoMap(Type type)
        {
            var mapType = typeof(DefaultClassMap <>).MakeGenericType(type);
            var map     = (ClassMap)ReflectionHelper.CreateInstance(mapType);

            map.AutoMap(this);
            maps.Add(map);

            return(map);
        }