Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
HIAST-Clinics
Commits
d9b88043
Commit
d9b88043
authored
Aug 16, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Link repos to program.cs
parent
77bcfade
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Program.cs
Clinics.Backend/API/Program.cs
+7
-0
No files found.
Clinics.Backend/API/Program.cs
View file @
d9b88043
using
API.Options.Database
;
using
API.Options.Database
;
using
Domain.Repositories.Base
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
using
Persistence.Context
;
using
Persistence.Context
;
using
Persistence.Repositories.Base
;
var
builder
=
WebApplication
.
CreateBuilder
(
args
);
var
builder
=
WebApplication
.
CreateBuilder
(
args
);
...
@@ -30,6 +32,11 @@ builder.Services.AddDbContext<ClinicsDbContext>(
...
@@ -30,6 +32,11 @@ builder.Services.AddDbContext<ClinicsDbContext>(
// Add services to the container.
// 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
#region Link controllers with presentation layer
var
presentationAssembly
=
typeof
(
Presentation
.
AssemblyReference
).
Assembly
;
var
presentationAssembly
=
typeof
(
Presentation
.
AssemblyReference
).
Assembly
;
builder
.
Services
.
AddControllers
()
builder
.
Services
.
AddControllers
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment