-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Startup.cs
35 lines (32 loc) · 1.07 KB
/
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
30
31
32
33
34
35
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using NetCoreKit.Infrastructure.Bus;
using NetCoreKit.Infrastructure.Bus.Redis;
using NetCoreKit.Infrastructure.EfCore.MySql;
using NetCoreKit.RestTemplate.EfCore;
using NetCoreKit.Samples.TodoAPI.Domain;
using NetCoreKit.Samples.TodoAPI.Infrastructure.Db;
using NetCoreKit.Samples.TodoAPI.Infrastructure.Gateways;
namespace NetCoreKit.Samples.TodoAPI
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddEfCoreTemplate<TodoListDbContext>(
svc =>
{
//svc.AddEfSqlLiteDb();
svc.AddEfCoreMySqlDb();
},
(svc, _) => { svc.AddScoped<IUserGateway, UserGateway>(); }
);
services.AddDomainEventBus();
//services.AddRedisBus(); //todo: enabled it if using a broker
}
public void Configure(IApplicationBuilder app)
{
app.UseEfCoreTemplate();
}
}
}