Extending DbContext

Extending EF Core DbContext

Entity Framework allows you to extend the DbContext class to add your own entities, extend existing entities, and customize them at runtime. All of these in a clean and simple manner, if you are willing to do so. It doesn’t even matter if those entities don’t have a table representation. You can do that by leveraging C# partial classes and method.