public static ShamanOptions WithSqlServer(this ShamanOptions options)
 {
     return(options
            .With <SqlServerReflectionService>()
            .With <SqlServerDirectSaverFactoryService>()
            .With <SqlServerFixerService>());
 }
 public static ShamanOptions With <T>(this ShamanOptions options) where T : IShamanService, new()
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     return(options.With(new T()));
 }
 /// <summary>
 ///     Include support for TableAttribute, ColumnAttribute, NotMappedAttribute,
 ///     RequiredAttribute, MaxLengthAttribute, IndexAttribute, UniqueIndexAttribute
 ///     and other
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public static ShamanOptions WithDefaultServices(this ShamanOptions options)
 {
     return(options
            .With <ColumnAttributeUpdater>()
            .With <NotMappedAttributeUpdater>()
            .With <NavigationPropertyAttributeUpdater>()
            .With <TimestampAttributeUpdater>()
            .With <DatabaseGeneratedAttributeUpdater>()
            .With <KeyAttributeUpdater>()
            .With <IndexAttributeUpdater>()
            .With <RequiredAttributeUpdater>()
            .With <MaxLengthAttributeUpdater>()
            .With <DecimalTypeAttributeUpdater>()
            .With <TableAttributeUpdater>()
            .With <DefaultValueAttributeUpdater>()
            .With <DefaultValueSqlAttributeUpdater>());
 }
示例#4
0
 /// <summary>
 ///     Include support for TableAttribute, ColumnAttribute, NotMappedAttribute,
 ///     RequiredAttribute, MaxLengthAttribute, IndexAttribute, UniqueIndexAttribute
 ///     and other
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public static ShamanOptions WithDefaultServices(this ShamanOptions options, Type dbContextType)
 {
     return(options
            .With <ColumnInfoColumnAttributeUpdater>()
            .With <NotMappedAttributeUpdater>()
            .With <NavigationPropertyAttributeUpdater>()
            .With(new NavigationPropertyByPropertyTypeUpdater(dbContextType))
            .With <TimestampAttributeUpdater>()
            .With <DatabaseGeneratedAttributeUpdater>()
            .With <KeyAttributeUpdater>()
            .With <IndexAttributeUpdater>()
            .With <RequiredAttributeUpdater>()
            .With <MaxLengthAttributeUpdater>()
            .With <DecimalTypeAttributeUpdater>()
            .With <UnicodeTextAttributeUpdater>()
            .With <TableAttributeUpdater>()
            .With <DefaultValueAttributeUpdater>()
            .With <DefaultValueSqlAttributeUpdater>()
            .With <DecimalPlacesColumnInfoUpdateService>()
            .With <DefaultValueColumnInfoUpdateService>()
            .With <UnicodeColumnInfoUpdateService>());
 }