Your team is developing an audit system where every database update or insert should include a timestamp. However, you don't want to include this property in your entity classes. How would you implement this in Entity Framework Core?
- Use Shadow Properties
- Create a Separate Audit Table
- Use Triggers
- Add Timestamp Property to Entity Classes
To achieve this without including the timestamp property in your entity classes, you can use Shadow Properties in Entity Framework Core. Shadow properties are properties that are not defined in your entity classes but are tracked by EF Core for specific purposes like auditing.
Loading...
Related Quiz
- With the migration from project.json to csproj, which tool became instrumental in converting the configurations and dependencies?
- In ASP.NET Core Identity, what's the best way to customize the hashing algorithm used for storing passwords?
- You've modified the properties of the IdentityUser class in your ASP.NET Core project. Before deploying these changes to production, which of the following steps is crucial to ensure the database reflects these modifications?
- You've heard about "middleware" in ASP.NET Core and learned that there's one for serving static content. What does this middleware help your web application do?
- After writing your ASP.NET Core application code, you want to build and run your application using a command-line tool. Which tool would you use for this purpose?