How to disable automapping of properties in Entity Framework

前端 未结 2 1021
太阳男子
太阳男子 2021-01-21 11:10

I\'ve decided to use fluent mapping in Entity Framework. My intention was to map everyting by code without any atributes and auto mapping functions. Best way I\'ve found is clas

2条回答
  •  醉酒成梦
    2021-01-21 11:54

    So far as I am aware, there is no other way around it. You need to use either Ignore() or [NotMapped]. I tend to prefer the former as it does not clutter up the model.

提交回复
热议问题