Reputation: 610
I am using EF 6.1 where I was trying to get a simple sample code running.
I accidentally used the namespace System.Data.Linq.Mapping (VS Intellisense) to realize the TableAttribute name parameter had no effect, the code created a new table (since POCO class name is different from table Name) when was executed. However, it was expected to use and existing table.
Latter after few googling effort I noticed the namespace System.ComponentModel.DataAnnotation is used in some places. When I made this change, my sample started using the existing table rather than creating it.
I would like to know
What is the difference between the TableAttribute class in these two namespaces?
Why did the TableAttribute in System.Data.Linq.Mapping not yield the expected behavior?
Upvotes: 2
Views: 1276
Reputation: 21224
System.Data.Linq.Mapping.TableAttribute
belongs to LINQ to Entities.System.ComponentModel.DataAnnotation.TableAttribute
Upvotes: 4