in my program.cs file i have the DB service setup as
builder.Services.AddDbContext<ADbContext>(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("ADevDB"));
});
and under the DatabaseConetxt class i have
public class ADbContext : DbContext
{
public ADbContext(DbContextOptions<ADbContext> options) : base(options)
{
}
}
i am trying to access EFCore in a custom filter class without constructor injection.
this is because when i apply the [CustomFilter]
on an action i don't want it to request that an argument needs to be passed to the customFilter Constructor for DBConetext