To access data from a controller, you need to declare an instance of the ApplicationDbContext class. I want to do this in the default constructor, but I get an error. I took an example from here tyts
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext() : base("DefaultConnection") { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(@"server=10.28.16.200;Integrated Security=false;User Id=test; Password=pass;database=Zaya"); } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); base.OnModelCreating(builder); } } Here are the contents of appsettings.json
"Data": { "DefaultConnection": { "ConnectionString": "server=10.28.16.200;Integrated Security=false;User Id=test; Password=Radzhab90;database=Zayavki" } This is the error that is encountered. Error CS1729 'IdentityDbContext' does not contain a constructor that takes arguments 1.
