示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConventionProfile"/> class.
 /// </summary>
 public ConventionProfile()
 {
     _aliasConvention              = new DelegateAliasConvention(m => m.Name);
     _collectionNameConvention     = new DelegateCollectionNameConvention(t => t.Name);
     _collectionAdapterConvention  = DefaultCollectionAdapterConvention.Instance;
     _defaultValueConvention       = DefaultDefaultValueConvention.Instance;
     _dictionaryAdapterConvention  = DefaultDictionaryAdapterConvention.Instance;
     _discriminatorConvention      = new DelegateDiscriminatorConvention(t => t.Name);
     _discriminatorAliasConvention = new DelegateDiscriminatorAliasConvention(t => "_t");
     _extendedPropertiesConvention = new DelegateExtendedPropertiesConvention(m => m.Name == "ExtendedProperties");
     _idConvention             = new DelegateIdConvention(m => m.Name == "Id");
     _idGeneratorConvention    = DefaultIdGeneratorConvention.Instance;
     _idUnsavedValueConvention = DefaultIdUnsavedValueConvention.Instance;
 }
 /// <summary>
 /// Uses the collection adapter convention.
 /// </summary>
 /// <param name="collectionAdapterConvention">The collection adapter convention.</param>
 /// <returns></returns>
 public AutoMappingProfileBuilder UseCollectionAdapterConvention(ICollectionAdapterConvention collectionAdapterConvention)
 {
     _profile.Conventions.CollectionAdapterConvention = collectionAdapterConvention;
     return this;
 }
 /// <summary>
 /// Uses the collection adapter convention.
 /// </summary>
 /// <param name="collectionAdapterConvention">The collection adapter convention.</param>
 /// <returns></returns>
 public AutoMappingProfileBuilder UseCollectionAdapterConvention(ICollectionAdapterConvention collectionAdapterConvention)
 {
     _profile.Conventions.CollectionAdapterConvention = collectionAdapterConvention;
     return(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConventionProfile"/> class.
 /// </summary>
 public ConventionProfile()
 {
     _aliasConvention = new DelegateAliasConvention(m => m.Name);
     _collectionNameConvention = new DelegateCollectionNameConvention(t =>  t.Name);
     _collectionAdapterConvention = DefaultCollectionAdapterConvention.Instance;
     _defaultValueConvention = DefaultDefaultValueConvention.Instance;
     _dictionaryAdapterConvention = DefaultDictionaryAdapterConvention.Instance;
     _discriminatorConvention = new DelegateDiscriminatorConvention(t => t.Name);
     _discriminatorAliasConvention = new DelegateDiscriminatorAliasConvention(t => "_t");
     _extendedPropertiesConvention = new DelegateExtendedPropertiesConvention(m => m.Name == "ExtendedProperties");
     _idConvention = new DelegateIdConvention(m => m.Name == "Id");
     _idGeneratorConvention = DefaultIdGeneratorConvention.Instance;
     _idUnsavedValueConvention = DefaultIdUnsavedValueConvention.Instance;
 }