Configuring with Data Annotations is fairly simple and it may be just what you’re looking for. But Data Annotations only allow you to access a subset of the possible configurations (though much more than you’ve seen so far). The Fluent API, however, gives you access to even more, so you may prefer it for this reason.
There’s another reason why some developers will prefer the Fluent
API over the annotations. While applying annotations to your pretty domain
classes, they can definitely get more and more bogged down with the
attributes. It’s one thing to be applying validation logic
MaxLength, etc.), but as you learn more about configuration options, you’ll see that there are also many that are specifically about how the class maps to the database. If you prefer cleaner classes, you ...