EF5, Data Annotations, Namespaces and Targeted .NET Versions

FIrst, be sure to read my post “When is EF5 not EF5” so you understand the basis for this post.

When you use EF5, regardless of targeting .NET 4 or .NET 4.5, you’ll find the special EF related data annotations (such as MaxLength and NotMapped) in the System.ComponentModel.DataAnnotations.Schema namespace.

In EF4, they were in System.ComponentModel.DataAnnotations namespace

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.