Im getting an error \"Invalid column name \'FeeLevel_LevelId\' which makes absolutely no sense considering all properties are simple types and there is no FeeLevel nor a Lev
FeeLevel.MemberFeeDiscountLevels
is a navigation property and it introduces a one-to-many relationship between FeeLevel
and MemberFeeDiscountLevel
: A FeeLevel
can have many MemberFeeDiscountLevels
which means at the same time that a MemberFeeDiscountLevel
has a single FeeLevel
. Although you don't have a navigation and foreign key property in MemberFeeDiscountLevel
the database must have a foreign key in the MemberFeeDiscountLevel
table in order to model this relationship. EF assumes a default FK name as "related entity name+underscore+primary key name" = FeeLevel_LevelId
. Because your database table doesn't have this column you get the exception.