Skip to content

Commit

Permalink
Revert "bug fix: remove unnecessary AppDbContext registration in Prog…
Browse files Browse the repository at this point in the history
…ram.cs"

This reverts commit dfbcfc2.
  • Loading branch information
mika-em committed Dec 5, 2024
1 parent 2da8f2b commit fbed4a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="System.Formats.Asn1" Version="9.0.0" />
<PackageReference Include="System.Formats.Asn1" Version="5.1.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions src/Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
// account service
builder.Services.AddScoped<IAccountService, AccountService>();

//register ApiDbContext
builder.Services.AddDbContext<ApiDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));


builder.Services.AddControllers()
.AddNewtonsoftJson(
options =>
Expand Down

0 comments on commit fbed4a7

Please sign in to comment.