File tree Expand file tree Collapse file tree
HRManagementSystem.Business/Services
HRManagementSystem.DataAccess/Concrete Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ public async Task<IResponse<List<AdvertisementListDto>>> GetActiveAsync()
3232 return new Response < List < AdvertisementListDto > > ( ResponseType . Success , dto ) ;
3333 }
3434 }
35- }
35+ }
Original file line number Diff line number Diff line change 11using HRManagementSystem . DataAccess . Configurations ;
22using HRManagementSystem . Entity . Concrete ;
33using Microsoft . EntityFrameworkCore ;
4+ using Microsoft . Extensions . Configuration ;
45using System ;
56using System . Collections . Generic ;
67using System . Linq ;
78using System . Text ;
89using System . Threading . Tasks ;
10+ using Microsoft . Extensions . Configuration ;
11+
912
1013namespace HRManagementSystem . DataAccess . Concrete
1114{
1215 public class HRContext : DbContext
1316 {
14- public HRContext ( DbContextOptions < HRContext > options ) : base ( options )
17+ private readonly IConfiguration _configuration ;
18+ public HRContext ( DbContextOptions < HRContext > options , IConfiguration configuration ) : base ( options )
1519 {
20+ _configuration = configuration ;
1621 }
1722
1823 protected override void OnConfiguring ( DbContextOptionsBuilder optionsBuilder )
1924 {
20- optionsBuilder . UseSqlServer ( "server=ENES\\ SQLEXPRESS;database=HRManagementDB;TrustServerCertificate=true;Trusted_Connection=true" ) ;
25+ var connectionString = _configuration . GetConnectionString ( "LOCAL" ) ;
26+ optionsBuilder . UseSqlServer ( connectionString ) ;
2127 }
22-
2328 protected override void OnModelCreating ( ModelBuilder modelBuilder )
2429 {
2530 modelBuilder . ApplyConfiguration ( new AdvertisementAppUserConfiguration ( ) ) ;
Original file line number Diff line number Diff line change 3333 < td > @advertisementAppUser .Advertisement .Title < / td >
3434 < td > @advertisementAppUser .AppUser .FirstName @advertisementAppUser .AppUser .LastName < / td >
3535 < td > @advertisementAppUser .AppUser .Gender .Definition < / td >
36- < td > @advertisementAppUser .AdvertisementAppUserStatus .Definition < / td >
36+ < td > @advertisementAppUser .AdvertisementAppUserStatus .Definition < / td >
3737 < td > @advertisementAppUser .MilitaryStatus .Definition < / td >
3838 < td > @(advertisementAppUser .EndDate == null ? " Done or exempt" : advertisementAppUser .EndDate ? .ToString (" dddd, dd MMMM yyyy" ))< / td >
3939 < td > @advertisementAppUser .WorkExperince < / td >
Original file line number Diff line number Diff line change 66 }
77 },
88 "ConnectionStrings" : {
9- "Local" :" ( server=ENES\\ SQLEXPRESS;database=HRManagementDB;TrustServerCertificate=true;Trusted_Connection=true\" ) ;"
9+ "Local" :" server=ENES\\ SQLEXPRESS;database=HRManagementDB;TrustServerCertificate=true;Trusted_Connection=true;"
1010 },
1111 "AllowedHosts" : " *"
1212}
You can’t perform that action at this time.
0 commit comments