TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

Scaffold EF Core models using Handlebars templates.
MIT License
209 stars 53 forks source link

Can rename DbSet Name? #91

Closed hayletdomybest closed 4 years ago

hayletdomybest commented 4 years ago

If any possibility to rename DbSet Name of DbContext, example like below

Schema: master Table : wheater_data Expected DbsetName : WheateDataList

    public MyDbContext(DbContextOptions<MyDbContext> options)
        : base(options)
    {
    }

    public virtual DbSet<WeatherData> WheateDataList{ get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        if (!optionsBuilder.IsConfigured)
        {
        }
    }
tonysneed commented 4 years ago

@Hsu-Cheng-We You'll need to add a partial MyDbContext class to your project, then manually add your DbSet<WeatherData> WheateDataList property. Generate the DbContext class separately from your entities and exclude the wheater_data table. Let me know if this answers your question.