The ObjectMapper .NET Project

Official blog of the AdFactum ObjectMapper .NET

Attribute: [PropertyName]

Posted by Gerhard Stephan on July 11th, 2006

The attribute PropertyName is used to specify the column name of the database table.

This attribute is NOT necessary to store a property in database, but it is necessary if you want to specify a column name that is independent from the name of the property. That’s maybe the case if you want to map your class to an already existing database table.

            [PropertyName("CULTURE")]

            public string CultureKey

            {

                  get { return _culture; }

                  set { _culture = value; }

            }

 

 The example above stores the property "CultureKey" in a column named "Culture".

 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 Votes | Average: 0 out of 5 (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

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