Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 810 Bytes

context_name.md

File metadata and controls

51 lines (37 loc) · 810 Bytes

Context Name

Why

Instead of using the database name as proposed context name, you may want to name the dervied DbContext after your domain or similar.

Before

efpt.config.json

   "ContextClassName": "NorthwindContext",

NorthwindContext.cs

public partial class NorthwindContext : DbContext
{
    public NorthwindContext()
    {
    }

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

After

efpt.config.json

   "ContextClassName": "CustomContext",

CustomContext.cs (file renamed)

public partial class CustomContext : DbContext
{
    public CustomContext()
    {
    }

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