PropertyBuilder<T> Does Not Contain A Definition For HasColumnType

These extensions are in the Microsoft.EntityFrameworkCore.Relational package as they are useful for modeling relational databases.

https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Relational/


I also had the same question. As per this Microsoft docs link https://docs.microsoft.com/en-us/ef/core/providers/ you would need to add a specific database provider nuget package, such as Microsoft.EntityFrameworkCore.SqlServer.

EF Core providers for relational databases are build on the common Microsoft.EntityFrameworkCore.Relational library, which provides APIs for configuring table and column mappings, foreign key constraints, etc. Providers are usually distributed as NuGet packages.

So no need to add both packages, adding the more specific one Microsoft.EntityFrameworkCore.SqlServer worked for me.