-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBootstrapper.cs
More file actions
26 lines (22 loc) · 1.02 KB
/
Bootstrapper.cs
File metadata and controls
26 lines (22 loc) · 1.02 KB
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
using BrixelAPI.SpaceState.Features.UpdateState;
using BrixelAPI.SpaceState.Infrastructure;
using FluentValidation;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace BrixelAPI.SpaceState
{
public static class Bootstrapper
{
public static void Configure(IServiceCollection serviceCollection, IConfiguration configuration)
{
serviceCollection.AddMediatR(x => x.RegisterServicesFromAssembly(typeof(Bootstrapper).Assembly));
serviceCollection.AddScoped<ISpaceStateRepository, SpaceStateRepository>();
serviceCollection.AddScoped<ISpaceStateUnitOfWork, SpaceStateUnitOfWork>();
serviceCollection.AddDbContext<SpaceStateContext>(options =>
options.UseSqlServer(configuration.GetConnectionString("SpaceAPIConnection")));
serviceCollection.AddValidatorsFromAssemblyContaining<ToggleIsOpenStateRequestValidator>();
}
}
}