How to ignore all properties that are marked as virtual

前端 未结 5 2125
误落风尘
误落风尘 2020-12-29 13:33

I am using virtual keyword for some of my properties for EF lazy loading. I have a case in which all properties in my models that are marked as virtual

5条回答
  •  春和景丽
    2020-12-29 13:53

    To correct the answer of @Alexei, don't use the ForSourceMember method, like it's answered here in this issu on github. It's just for validation.

    An other way is to use ForAllPropertyMaps like in this answer.

提交回复
热议问题