I have a Net Core 3.1.1 (Blazor) app that i have generated a "reverse engineer" configuration via EntityFramework PowerTools for. This generates dbcontext and allows me to assign tables from my dbase into the model. I have done this correctly with another
project, but the project I am now trying this with is giving me "Type or namespace .." error in startup.cs
Efpt.configu json (partial)
{
"ContextClassName": "MyDatabaseContext",
"ContextNamespace": null,
"DefaultDacpacSchema": null,
"DoNotCombineNamespace": false,
"IdReplace": false,
"IncludeConnectionString": false,
"ModelNamespace": null,
"OutputContextPath": null,
"OutputPath": "Data\\MyProject",
"ProjectRootNamespace": "MyProjectDB",
"SelectedHandlebarsLanguage": 0,
"SelectedToBeGenerated": 0,
"Tables": [
{
"HasPrimaryKey": true,
"Name": "[dbo].[MyTable]"
}
],
....
my startup.cs for the ConfigureServices method, with using headers for startup.cs:
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MyProject.Areas.Identity;
using MyProject.Data;
namespace MyProject
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = false)
.AddEntityFrameworkStores<ApplicationDbContext>();
// Read the connection string from the appsettings.json file
// Set the database connection for the MyDatabaseContext
services.AddDbContext<MyProjectDB.Data.MyProjectDB.MyProjectDBContext>
.....
..whereas MyProjectDB inside this last line for the list type is where the error is pointing, but i do have MyProjectDB assigned inside efpt.config.json as the projectname rootspace
??
thanks in advance
Ned