'propertyName' cannot be used as a property on entity type 'typeName' because it is configured as a navigation
I was trying to create an index on a navigation property. Instead, create the index on the foreign key.
Change user.HasIndex(x => x.Gender)
to user.HasIndex(x => x.GenderId)
.