I have been scaffolded existing DB from SQL Server to my project with EntityFrameworkCore and it created models with
public DateTime Birthday { get; set; }
Now I have to change DateTime to DateOnly This exception is thrown when I'm trying to read Date (SQL Server) with model which has field
public DateOnly Birthday { get; set; }
Exception: The property is of type 'DateOnly' which is not supported by the current database provider. Either change the property CLR type, or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
How can I use DateOnly struct from .NET 6.0 with SQL Server Date type?