entity-framework-logo

Fixing the error: “Column XX in table dbo.YY is of a type that is invalid for use as a key column in an index.”

While using Entity Framework and code-first migrations, Entity Framework (EF) creates the indexes for you – but what if you need to create a custom one, explicitly based on a certain field/column? Then you’ll have to tell EF which one to use as a key column. Usually, it’s easy –…Continue reading Fixing the error: “Column XX in table dbo.YY is of a type that is invalid for use as a key column in an index.”