Home > Net >  The type or namespace name 'DatabaseContext' could not be found
The type or namespace name 'DatabaseContext' could not be found

Time:01-05

class DatabaseContext:DbContext
{
    public DatabaseContext(DbContextOptions<DatabaseContext> options):base(options)
    {

    }
}

public void ConfigureServices(IServiceCollection services)
{
    services.AddControllersWithViews();
    services.AddDbContext<DatabaseContext>
}

I have tried uninstall then reinstall EntityFrameworkCore.But It didnt work.How can I fix it.Thank you in advance

CodePudding user response:

Classes, records, and structs declared directly within a namespace (in other words, that aren't nested within other classes or structs) can be either public or internal. internal is the default if no access modifier is specified.

Class, record, and struct member accessibility

Internal types or members are accessible only within files in the same assembly they are defined: internal (C# Reference)

  • Related