System.Data.SqlClient.SqlException: Invalid column name 'phone_types_phone_type_id'

前端 未结 7 619
野的像风
野的像风 2020-12-10 02:28

I\'m trying to get information from some of my models that have a foreign key relationships to my main employee model. If I map out each model individually, I can access the

7条回答
  •  [愿得一人]
    2020-12-10 02:49

    I had the similar issue. What happens is that in the database foreign keys are created and it starts mapping both the models and then throws an exception. Best way is to avoid foreign key creation by using [NotMapped] as you could use complex models and also avoid creation of Foreign Key.

提交回复
热议问题