Esempio n. 1
0
        /// <summary>
        /// Add a profile to the configuration
        /// </summary>
        /// <param name="profile"></param>
        public void AddProfile(Profile profile)
        {
            // resolve the current configuration and add it
            var registry = MappingConfigurationResolutionContext.GetMappingRegistry();

            registry.AddMapping(true, profile);
        }
Esempio n. 2
0
        /// <summary>
        /// Add multiple profiles to the configuration
        /// </summary>
        /// <param name="profile"></param>
        public void AddProfiles(IEnumerable <Profile> profiles)
        {
            // resolve the current configuration and add it
            var registry = MappingConfigurationResolutionContext.GetMappingRegistry();

            foreach (var profile in profiles)
            {
                registry.AddMapping(true, profile);
            }
        }
Esempio n. 3
0
        public IMappingExpression <TSource, TDest> ForMember(Expression <Func <TDest, object> > destination, Expression <Func <TSource, object> > source)
        {
            Source      = source;
            Destination = destination;

            // resolve the current configuration and add it
            var registry = MappingConfigurationResolutionContext.GetMappingRegistry();

            registry.AddMapping(this);

            return(new MappingExpression <TSource, TDest>(ProfileType));
        }
Esempio n. 4
0
        internal ICollection <FieldMap> GetMappings()
        {
            var registry = MappingConfigurationResolutionContext.GetMappingRegistry();

            return(registry.Mappings.Where(x => x.ProfileType == this.GetType()).ToList());
        }