Add dependency Injection

This commit is contained in:
2023-10-16 22:02:02 +02:00
parent 3e3ef39b80
commit 707bfae2e3
4 changed files with 33 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
using GerbilManager.Repositories;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
@@ -7,6 +9,8 @@ builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<IGerbilRepository, InMemGerbilRepository>();
var app = builder.Build();
// Configure the HTTP request pipeline.