开发者

Entity Framework 4.1:is it preferred to annotate properties or to use Fluent API

开发者 https://www.devze.com 2023-02-25 15:26 出处:网络
As the title implies: what are the pros and cons using Annotations in开发者_如何学Pythonstead of the Fluent API (or reversed)?If you are purist you will not use Data Annotations because they make your

As the title implies: what are the pros and cons using Annotations in开发者_如何学Pythonstead of the Fluent API (or reversed)?


If you are purist you will not use Data Annotations because they make your POCO class little bit dirty. Also data annotations are only for simple mapping features. If you need more complex mapping you have to use fluent API anyway. Final choice for basic mapping is subjective.

0

精彩评论

暂无评论...
验证码 换一张
取 消