Is there a good reason why the Table attribute (which can be used to map a POCO class to the correct database name/schema) is in the EntityFramework.dll?
Doesn’t this prevent you from creating a Domain project that simply contains your entities with no dependency on a specific data access technology? For example, if I use this attribute I don’t believe the classes would be portable to Silverlight.
Is this an oversight, or am I missing something?
I realize I could use the fluent API to circumvent this, but the attribute seems preferable for this purpose.
I think because the TableAttribute has been added in EF 4.1. It belongs to namespace
System.ComponentModel.DataAnnotationsand would probably have been added toSystem.ComponentModel.DataAnnotations.dllassembly if EF 4.1 had been part of a regular .NET Framework release. But because EF 4.1 was released independently from a Framework update they couldn’t touch the framework core assemblies. So, it is for now in EntityFramework.dll but still inSystem.ComponentModel.DataAnnotationsnamespace, so somehow independent from Entity Framework. Maybe it will be moved intoSystem.ComponentModel.DataAnnotations.dllwith the next .NET Framework version.For now, if you want to decorate your POCOs with the TableAttribute you must reference EntityFramework.dll. I wouldn’t consider this as dependency from Entity Framework as long as you don’t use the “real” EF stuff (
DbContext, etc.) in your custom assembly.