Attribute: [Table]
Posted by Gerhard Stephan on 13th July 2006
The table attribute is used to rename the mapping from class to database table.
[Table („CONTACTS“)]
public class Contact : ValueObject
The ObjectMapper .NET does not need that property to map the class to a database table. If the attribute misses, the class name itself will be taken as the valid name for the database table.
But most times it makes sense to rename the mapping of the class to the underlaying database table. Imagine your class is named "Contact", so you would instinctively name your database table "Contacts". That is because the database table contains the plural of your entities, but the class itself is defined as a singular entity.
Posted in Attributes | No Comments »
