Пример #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;
 }
Пример #2
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;
 }