AdFactum ObjectMapper .NET Blog

Official blog of the AdFactum ObjectMapper .NET

Attribute: [Table]

Posted by Gerhard Stephan on July 13th, 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.


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>