Attaching an entity of type failed because another entity of the same type already has the same primary key value.

后端 未结 3 2067
深忆病人
深忆病人 2020-12-10 17:03

Let me quickly describe my problem.

I have 5 databases for 5 customers and each has the same table called SubnetSettings.

3条回答
  •  清歌不尽
    2020-12-10 17:56

    I'm not sure the following line is doing what you intend:

    Mapper.Map(categoryFromViewModel, categoryFromBase);
    

    I think the following is what you want:

    Category categoryFromBase = Mapper.Map(categoryFromViewModel)
    

提交回复
热议问题