You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a better way to handle a base entity inheritance in a context class for shared properties? Specifically if you have a base with createdAt and updatedAt, I find that I have to manually add a HasDefaultValueSql for both properties on each table. I am using ef6 and npgsql for my db connection.
using System.ComponentModel.DataAnnotations;using System.ComponentModel.DataAnnotations.Schema;namespace SudorNET.Db.Models;publicabstractrecordBase{[DatabaseGenerated(DatabaseGeneratedOption.Identity)][Key]publicintId{get;set;}publicDateTimeCreatedAt{get;set;}publicDateTimeUpdatedAt{get;set;}}
The text was updated successfully, but these errors were encountered:
Is there a better way to handle a base entity inheritance in a context class for shared properties? Specifically if you have a base with createdAt and updatedAt, I find that I have to manually add a HasDefaultValueSql for both properties on each table. I am using ef6 and npgsql for my db connection.
.NET 6
EF Core version 6.0.1
npgsql 6.0.3
DbContext.cs
Base.cs
The text was updated successfully, but these errors were encountered: