控制台迁移去掉泛型

This commit is contained in:
xuejiaming 2023-02-22 14:19:11 +08:00
parent 8e4a853619
commit d8f646a0d3
2 changed files with 3 additions and 3 deletions

View File

@ -41,9 +41,9 @@ namespace Sample.Migrations
op.UseShardingMigrationConfigure(op => op.UseShardingMigrationConfigure(op =>
{ {
op.ReplaceService<IMigrationsSqlGenerator, op.ReplaceService<IMigrationsSqlGenerator,
ShardingSqlServerMigrationsSqlGenerator<DefaultShardingTableDbContext>>(); ShardingSqlServerMigrationsSqlGenerator>();
}); });
}).ReplaceService<ITableEnsureManager,SqlServerTableEnsureManager>().EnsureConfig(); }).EnsureConfig();
_serviceProvider = services.BuildServiceProvider(); _serviceProvider = services.BuildServiceProvider();
} }

View File

@ -13,7 +13,7 @@ namespace Sample.Migrations.EFCores
/// <summary> /// <summary>
/// https://github.com/Coldairarrow/EFCore.Sharding/blob/master/src/EFCore.Sharding.SqlServer/ShardingSqlServerMigrationsSqlGenerator.cs /// https://github.com/Coldairarrow/EFCore.Sharding/blob/master/src/EFCore.Sharding.SqlServer/ShardingSqlServerMigrationsSqlGenerator.cs
/// </summary> /// </summary>
public class ShardingSqlServerMigrationsSqlGenerator<TShardingDbContext> : SqlServerMigrationsSqlGenerator where TShardingDbContext:DbContext,IShardingDbContext public class ShardingSqlServerMigrationsSqlGenerator : SqlServerMigrationsSqlGenerator
{ {
private readonly IShardingRuntimeContext _shardingRuntimeContext; private readonly IShardingRuntimeContext _shardingRuntimeContext;