filmov
tv
Log Data Changes in Entity Framework - Part 1 - Create Entities and DbContext's

Показать описание
It's become more important to be able to log data changes in Entity Framework, but how do you go about and do that?
In this example, we will have two databases, with each database having it's own DbContext. Our "data" database will store our records for our entities. The other database will be our "change" database. This will have a separate table for each entity that we wish to log data changes to. However, the columns for these tables will be the same.
We will go ahead and set up our entities. Afterwards, we will set up our DbContext's and integrate them with Entity Framework. Finally, we will use EF Migrations for both our DbContext's to create our databases, and create the relevant tables.
📖 Learn .NET and C# with our online courses 📖
#entityframework #dbcontext
In this example, we will have two databases, with each database having it's own DbContext. Our "data" database will store our records for our entities. The other database will be our "change" database. This will have a separate table for each entity that we wish to log data changes to. However, the columns for these tables will be the same.
We will go ahead and set up our entities. Afterwards, we will set up our DbContext's and integrate them with Entity Framework. Finally, we will use EF Migrations for both our DbContext's to create our databases, and create the relevant tables.
📖 Learn .NET and C# with our online courses 📖
#entityframework #dbcontext