Patched DateOnly columns
This commit is contained in:
committed by
Chris
parent
416d668294
commit
ba0a5f1b6e
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user