Search code examples
c#entity-framework-corefluent-entity-framework

PropertyBuilder<T> Does Not Contain A Definition For HasColumnType


I just built up a bunch of POCO classes and a DbContext class utilizing EntityFramework Core and the Scaffold-DbContext NuGet Package Manager Console command.

It generated a bunch of code and most of it is fine, except there are several calls to HasColumnType and HasName methods that are not found by the compiler. Unfortunately, VS2017 isn't helping me locate them either. I installed EntityFramework Core via the NuGet Package Manager and I figured all dependencies would've been correctly installed, but this does not appear to be the case. I've tried googling the namespace for HasColumnType but have been unable to find it.

Could someone please tell me what namespace or NuGet package I'm missing?


Solution

  • 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/