/
Startup.cs
29 lines (27 loc) · 940 Bytes
/
Startup.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Smartstore.Core.Data;
using Smartstore.Data;
using Smartstore.Data.Providers;
using Smartstore.Engine;
using Smartstore.Engine.Builders;
namespace Smartstore.Google.MerchantCenter
{
internal class Startup : StarterBase
{
public override void ConfigureServices(IServiceCollection services, IApplicationContext appContext)
{
services.AddTransient<IDbContextConfigurationSource<SmartDbContext>, SmartDbContextConfigurer>();
}
class SmartDbContextConfigurer : IDbContextConfigurationSource<SmartDbContext>
{
public void Configure(IServiceProvider services, DbContextOptionsBuilder builder)
{
builder.UseDbFactory(b =>
{
b.AddModelAssembly(GetType().Assembly);
});
}
}
}
}