title: POCO entity Fluent API versus Data Annotations
body: <p>I am coding our POCO entities in a <strong>Domain</strong> project in which I have no references to either <code>EntityFramework</code> or <code>DataAnnotations</code>. A second project, <strong>DataAccess</strong>, contains the data context and fluent configuration of entities.</p>
  
  <p>Some entity properties are <code>IsRequired</code> or <code>HasMaxLength</code>. Developers using the Domain will not know what is required or if there is a maximum length of the property without Xml commented documentation. So, I've added documentation to the properties to convey the requirements.  </p>
  
  <p>The problem is, however, if a requirement changes I have to update the comments. This means that I'm updating 2 libraries - Domain and DataAccess.  </p>
  
  <p>I've been apprehensive in referencing DataAnnotations in the Domain; there are no attributes on my properties. These attributes would give a developer with access to the Domain entities knowledge of what is required or if there is a max length for a property.  </p>
  
  <p>Is there another way to convey property requirements for properties without using DataAnnotations on the entities or having to update the Xml comments on the entities?  </p>
  
  <p>Or, am I being unnecessarily thick-headed about adding the <code>DataAnnotation</code> reference to the Domain project?</p>