Posted by Gerhard Stephan on June 11th, 2007
The property PrimaryKey can be used to tag a property that acts as a primary key column for the mapped table. In our classes ValueObject and AutoIncValueObject the Id Property has this attribute already assigned. Therefore this is only important if you write your own base classes or you define interfaces that shall be mapped.
/// Interface that describes a person
public interface IPerson : IValueObject
/// Gets or sets the unique value object id.
/// <value>The unique value object id.</value>
new int? Id
Note: Combined primary keys are not allowed using the AdFactum ObjectMapper .NET.
Hint: It’s also valid to tag the primary key property with additional attributes, like [PropertyName] or [PropertyLength] to change the database binding.