|
46 | 46 | using VirtoCommerce.Platform.Core.Settings;
|
47 | 47 | using VirtoCommerce.Platform.Data.Extensions;
|
48 | 48 | using VirtoCommerce.Platform.Data.MySql;
|
| 49 | +using VirtoCommerce.Platform.Data.MySql.Extensions; |
49 | 50 | using VirtoCommerce.Platform.Data.MySql.HealthCheck;
|
50 | 51 | using VirtoCommerce.Platform.Data.PostgreSql;
|
| 52 | +using VirtoCommerce.Platform.Data.PostgreSql.Extensions; |
51 | 53 | using VirtoCommerce.Platform.Data.PostgreSql.HealthCheck;
|
52 | 54 | using VirtoCommerce.Platform.Data.Repositories;
|
53 | 55 | using VirtoCommerce.Platform.Data.SqlServer;
|
| 56 | +using VirtoCommerce.Platform.Data.SqlServer.Extensions; |
54 | 57 | using VirtoCommerce.Platform.Data.SqlServer.HealthCheck;
|
55 | 58 | using VirtoCommerce.Platform.DistributedLock;
|
56 | 59 | using VirtoCommerce.Platform.Hangfire.Extensions;
|
@@ -133,19 +136,18 @@ public void ConfigureServices(IServiceCollection services)
|
133 | 136 |
|
134 | 137 | services.AddDbContext<PlatformDbContext>((provider, options) =>
|
135 | 138 | {
|
136 |
| - var databaseProvider = Configuration.GetValue("DatabaseProvider", "SqlServer"); |
137 | 139 | var connectionString = Configuration.GetConnectionString("VirtoCommerce");
|
138 | 140 |
|
139 | 141 | switch (databaseProvider)
|
140 | 142 | {
|
141 | 143 | case "MySql":
|
142 |
| - options.UseMySqlDatabase(connectionString); |
| 144 | + options.UseMySqlDatabase(connectionString, typeof(MySqlDataAssemblyMarker), Configuration); |
143 | 145 | break;
|
144 | 146 | case "PostgreSql":
|
145 |
| - options.UsePostgreSqlDatabase(connectionString); |
| 147 | + options.UsePostgreSqlDatabase(connectionString, typeof(PostgreSqlDataAssemblyMarker), Configuration); |
146 | 148 | break;
|
147 | 149 | default:
|
148 |
| - options.UseSqlServerDatabase(connectionString); |
| 150 | + options.UseSqlServerDatabase(connectionString, typeof(SqlServerDataAssemblyMarker), Configuration); |
149 | 151 | break;
|
150 | 152 | }
|
151 | 153 | });
|
@@ -203,13 +205,13 @@ public void ConfigureServices(IServiceCollection services)
|
203 | 205 | switch (databaseProvider)
|
204 | 206 | {
|
205 | 207 | case "MySql":
|
206 |
| - options.UseMySqlDatabase(connectionString); |
| 208 | + options.UseMySqlDatabase(connectionString, typeof(MySqlDataAssemblyMarker), Configuration); |
207 | 209 | break;
|
208 | 210 | case "PostgreSql":
|
209 |
| - options.UsePostgreSqlDatabase(connectionString); |
| 211 | + options.UsePostgreSqlDatabase(connectionString, typeof(PostgreSqlDataAssemblyMarker), Configuration); |
210 | 212 | break;
|
211 | 213 | default:
|
212 |
| - options.UseSqlServerDatabase(connectionString); |
| 214 | + options.UseSqlServerDatabase(connectionString, typeof(SqlServerDataAssemblyMarker), Configuration); |
213 | 215 | break;
|
214 | 216 | }
|
215 | 217 |
|
|
0 commit comments