Table of Contents

IT:AD:Code First:DataAnnotations

Summary

Important: the use of `DataAnnotations` is not recommended in anything but a POC.
  • Domain Entities should be in their own assembly.
  • Decorating domain Entities/ with Attributes drag in – and therefore to all assemblies referring to domain entities (ie everywhere) – creates brittle cod e(see: IT:AD:Patterns:Vendors Suck Strategy).
  • Prefer the fluent approach: IT:AD:Code First:FluentAPI
    • Not only do they not cause dependencies, but the Fluent approach offers more options.

#

# Attributes ##

That said, the most common EF Attributes one can apply are:

Resources