I am new to ASP / EF. I am using ASP 5 and Entity Framework 7 in my personal project.
Thus, I can create a database and tables with the first code approach, but all table names are unique and are not duplicated by default.
In my ServerMatrixDemoDB DbContext file that I created below DBSets:
public class ServerMatrixDemoDB : DbContext { public ServerMatrixDemoDB() { Database.EnsureCreated(); } public DbSet<Domain> Domains { get; set; } public DbSet<Environment> Environments { get; set; } public DbSet<Network> Networks { get; set; } public DbSet<OsVersion> OsVersions { get; set; } public DbSet<Tier> Tiers { get; set; } public DbSet<Service> Services { get; set; } public DbSet<HardwareType> HardwareTypes { get; set; } public DbSet<Powershell> Powershell { get; set; } public DbSet<DotNetVersion> DotNetVersions { get; set; } public DbSet<Status> Status { get; set; } public DbSet<Servers> Servers { get; set; } public DbSet<Application> Applications { get; set; } }
And in my startup.cs file, I use the code below:
public void ConfigureServices(IServiceCollection services) { services.AddMvc()
As soon as I create and run a project, a database and tables are created, but all table names are unique. Is there a way to pluralize table names in the first code approach?
Ray
source share