Skip to content

Commit

Permalink
Merge pull request #4239 from cisagov/marcus-fix-dbfacotry-multiple-c…
Browse files Browse the repository at this point in the history
…onstructors-error

Decorate Context Constructor With ActivatorUtilitiesConstructor To Tell Which Constructor Should Be Used by DI
  • Loading branch information
Marcus-Goectau authored Nov 22, 2024
2 parents 15d21d4 + e23386a commit 5a76559
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Snickler.EFCore;

namespace CSETWebCore.DataLayer.Model
Expand All @@ -27,6 +28,7 @@ public CSETContext()
{
}

[ActivatorUtilitiesConstructor]
public CSETContext(IConfiguration config)
{
_connectionString = config.GetConnectionString("CSET_DB");
Expand Down

0 comments on commit 5a76559

Please sign in to comment.