/// <summary> /// Configures the default profile. /// </summary> /// <param name="defaultProfile">The default profile.</param> public void DefaultProfile(IAutoMappingProfile defaultProfile) { if (defaultProfile == null) { throw new ArgumentNullException("defaultProfile"); } _defaultProfile = defaultProfile; }
/// <summary> /// Configures the default profile. /// </summary> /// <param name="config">The config.</param> public void DefaultProfile(Action <AutoMappingProfileBuilder> config) { if (config == null) { throw new ArgumentNullException("config"); } var dp = _defaultProfile as AutoMappingProfile ?? new AutoMappingProfile(); config(new AutoMappingProfileBuilder(dp)); _defaultProfile = dp; }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMappingProfile" /> class. /// </summary> /// <param name = "profile">The profile.</param> /// <param name = "overrides">The overrides.</param> public OverridableAutoMappingProfile(IAutoMappingProfile profile, ClassOverridesMap overrides) { if (overrides == null) { throw new ArgumentNullException("overrides"); } if (profile == null) { throw new ArgumentNullException("profile"); } _overrides = overrides; _profile = profile; }
/// <summary> /// Adds a custom profile. /// </summary> /// <param name="filter">The filter.</param> /// <param name="profile">The profile.</param> public void CustomProfile(Func <Type, bool> filter, IAutoMappingProfile profile) { if (filter == null) { throw new ArgumentNullException("filter"); } if (profile == null) { throw new ArgumentNullException("profile"); } _profiles.Add(new FilteredProfile { Filter = filter, Profile = profile }); }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMappingStore" /> class. /// </summary> /// <param name = "profile">The profile.</param> /// <param name = "mappingStore">The mapping store.</param> public AutoMappingStore(IAutoMappingProfile profile, IMappingStore mappingStore) : this(new AutoMapper(profile), mappingStore) { }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMappingStore" /> class. /// </summary> /// <param name = "profile">The profile.</param> public AutoMappingStore(IAutoMappingProfile profile) : this(new AutoMapper(profile), null) { }
/// <summary> /// Creates the overrideable profile. /// </summary> /// <param name="profile">The profile.</param> /// <returns></returns> private IAutoMappingProfile CreateOverrideableProfile(IAutoMappingProfile profile) { return(new OverridableAutoMappingProfile(profile, _overrides)); }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMapper" /> class. /// </summary> /// <param name = "profile">The profile.</param> /// <param name = "filter">The filter.</param> public AutoMapper(IAutoMappingProfile profile, Func <Type, bool> filter) { _filter = filter ?? new Func <Type, bool>(t => true); _profile = profile ?? new AutoMappingProfile(); }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMapper" /> class. /// </summary> /// <param name = "profile">The profile.</param> public AutoMapper(IAutoMappingProfile profile) : this(profile, null) { }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMapper" /> class. /// </summary> /// <param name = "profile">The profile.</param> /// <param name = "filter">The filter.</param> public AutoMapper(IAutoMappingProfile profile, Func<Type, bool> filter){ _filter = filter ?? new Func<Type, bool>(t => true); _profile = profile ?? new AutoMappingProfile(); }
/// <summary> /// Initializes a new instance of the <see cref = "AutoMapper" /> class. /// </summary> /// <param name = "profile">The profile.</param> public AutoMapper(IAutoMappingProfile profile) : this(profile, null){ }