|
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;
|
@@ -135,19 +138,18 @@ public void ConfigureServices(IServiceCollection services)
|
135 | 138 |
|
136 | 139 | services.AddDbContext<PlatformDbContext>((provider, options) =>
|
137 | 140 | {
|
138 |
| - var databaseProvider = Configuration.GetValue("DatabaseProvider", "SqlServer"); |
139 | 141 | var connectionString = Configuration.GetConnectionString("VirtoCommerce");
|
140 | 142 |
|
141 | 143 | switch (databaseProvider)
|
142 | 144 | {
|
143 | 145 | case "MySql":
|
144 |
| - options.UseMySqlDatabase(connectionString); |
| 146 | + options.UseMySqlDatabase(connectionString, typeof(MySqlDataAssemblyMarker), Configuration); |
145 | 147 | break;
|
146 | 148 | case "PostgreSql":
|
147 |
| - options.UsePostgreSqlDatabase(connectionString); |
| 149 | + options.UsePostgreSqlDatabase(connectionString, typeof(PostgreSqlDataAssemblyMarker), Configuration); |
148 | 150 | break;
|
149 | 151 | default:
|
150 |
| - options.UseSqlServerDatabase(connectionString); |
| 152 | + options.UseSqlServerDatabase(connectionString, typeof(SqlServerDataAssemblyMarker), Configuration); |
151 | 153 | break;
|
152 | 154 | }
|
153 | 155 | });
|
@@ -205,13 +207,13 @@ public void ConfigureServices(IServiceCollection services)
|
205 | 207 | switch (databaseProvider)
|
206 | 208 | {
|
207 | 209 | case "MySql":
|
208 |
| - options.UseMySqlDatabase(connectionString); |
| 210 | + options.UseMySqlDatabase(connectionString, typeof(MySqlDataAssemblyMarker), Configuration); |
209 | 211 | break;
|
210 | 212 | case "PostgreSql":
|
211 |
| - options.UsePostgreSqlDatabase(connectionString); |
| 213 | + options.UsePostgreSqlDatabase(connectionString, typeof(PostgreSqlDataAssemblyMarker), Configuration); |
212 | 214 | break;
|
213 | 215 | default:
|
214 |
| - options.UseSqlServerDatabase(connectionString); |
| 216 | + options.UseSqlServerDatabase(connectionString, typeof(SqlServerDataAssemblyMarker), Configuration); |
215 | 217 | break;
|
216 | 218 | }
|
217 | 219 |
|
|
0 commit comments