I have been googling this non stop for 2 days now and can\'t find a single complete, ready to use, fully implemented t4 template that generates DataAnnotations. Do they eve
Here is what you want!
T4 Metadata and Data Annotations Template
This T4 template handles generating metadata classes from an Entity Framework 4 model and decorates properties with data annotation attributes such as [Required] and [StringLength]. The [DataType] attribute is also applied when appropriate. It'll also generate ErrorMessage values based upon property names for required fields.