Patched DateOnly columns

This commit is contained in:
Christopher Sanden
2026-03-29 14:35:15 +02:00
committed by Chris
parent 416d668294
commit ba0a5f1b6e
8 changed files with 847 additions and 5 deletions

View File

@@ -14,4 +14,17 @@ public class ApplicationDbContext : IdentityDbContext
public DbSet<Author> Authors => Set<Author>();
public DbSet<Book> Books => Set<Book>();
public DbSet<Review> Reviews => Set<Review>();
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.Entity<Author>()
.Property(author => author.Birthdate)
.HasColumnType("date");
builder.Entity<Book>()
.Property(book => book.Published)
.HasColumnType("date");
}
}