Entity Framework EntityKey / Foreign Key problem

前端 未结 3 1190
借酒劲吻你
借酒劲吻你 2020-12-10 07:23

As the result of a form post, I\'m trying to save a new Brand record. In my view, Gender is a dropdown, returning an Integer, which is populated from ViewData(\"gender\")

3条回答
  •  忘掉有多难
    2020-12-10 07:30

    What you need is an instance of both Brand and Gender and then set Brand.Gender to the instance of the Gender. Then you can save without problems.

提交回复
热议问题