You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2026. It is now read-only.
StrutTower edited this page Jul 3, 2024
·
2 revisions
When using the Property Name method for initializing a repository, attributes can be used on the class and properties to configure the database mapping.
[TableName]
The TableNameAttribute can be used to manually set the name of the database table if the name doesn't match the class name
The AutonumberAttribute is used to map a property as a primary key with autonumber/autoincrement
Placement: Property
Example:
[Autonumber]publicintID{get;set;}
[KeyMap]
The KeyMapAttribute is use to map a property as a primary key. Similar to [Key] in EntityFramework.
Placement: Property
Example:
[KeyMap]publicintID{get;set;}
[ColumnMap]
The ColumnMapAttribute is use to set a column name that is different from the property name. Similar to [Column] in EntityFramework.
Placement: Property
Example:
[ColumnMap("Active")]publicboolIsActive{get;set;}
[SkipMapping]
The SkipMappingAttribute is used to prevent mapping a property to a database column. Use this if you have an extra property that doesn't match any database column. Similar to [NotMapped] in EntityFramework.