Commit d9b88043 authored by Almouhannad's avatar Almouhannad

(B) Link repos to program.cs

parent 77bcfade
using API.Options.Database;
using Domain.Repositories.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Persistence.Context;
using Persistence.Repositories.Base;
var builder = WebApplication.CreateBuilder(args);
......@@ -30,6 +32,11 @@ builder.Services.AddDbContext<ClinicsDbContext>(
// Add services to the container.
#region Link repositories
// AddTransient: Created on demand, every time they are requested, not shared across requests or components.
builder.Services.AddTransient(typeof(IRepository<>), typeof(Repositroy<>));
#endregion
#region Link controllers with presentation layer
var presentationAssembly = typeof(Presentation.AssemblyReference).Assembly;
builder.Services.AddControllers()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment