I have this sample code:
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Models;
namespace MySampleNamespace
{
For EFCore 3.1 I needed to use this in my DB context:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
foreach (IMutableEntityType entity in modelBuilder.Model.GetEntityTypes())
{
entity.SetTableName("WS_" + entity.GetTableName());
}
}
No additional Nuget package was required.