TLDR; Microsoft Documentation for .HasColumnType() states "... should be the complete type name, including precision, scale, length ...". This seems to be in contradiction to this stack overflow answer - has the recommended usage changed ?
Using EF Core 3.1 (and 5), SQLite and Northwind database, following examples from MJPrice Cs8 & .Net Core 3 Chapter14, I used dotnet ef scaffold ...
to create similar code and compare to the book. This tool generates a lot of .HasColumnType() methods, and no HasMaxLength() methods.
Is maximum length correctly captured when replacing .HasMaxLength(15)
with .HasColumnType("nvarchar(15)")
(example for the CategoryName property of Category) ?
Is .HasColumnType() unnecessary due to the way SQLite stores types and therefore only the maximum length information is really needed for this example i.e. database provider is SQLite?