Project Name: Company.Account.API
Context Namespace: Company.Account.API.Data
Default Namespace: Company.Account.API.DataModels
Table Name: Account
Error message in "ApplicationDbContext.cs" "Account" is a namespace but used like a type
Code: Select all
namespace Company.Account.API.Data
{
public virtual DbSet<Account> Accounts { get; set; }
}
Workaround: You must manually edit and update each file to fix the issue.
Change name from "Account" to "Account.API.DataModels.Account"
Example
1)
From
Code: Select all
public virtual DbSet<Account> Accounts { get; set; }
Code: Select all
public virtual DbSet<Account.API.DataModels.Account> Accounts { get; set; }
2)
From
Code: Select all
#region Account Navigation properties
modelBuilder.Entity<Account>().HasOne(x => x.AccountType).WithMany(op => op.Accounts).IsRequired(true).HasForeignKey(@"AccountTypeId");
#endregion
Code: Select all
#region Account Navigation properties
modelBuilder.Entity<Account.API.DataModels.Account>().HasOne(x => x.AccountType).WithMany(op => op.Accounts).IsRequired(true).HasForeignKey(@"AccountTypeId");
#endregion