NPersistence Reference Guide
Specifies the primary key of an entity.

The field or property to which the Id annotation is applied should be one of the following types:

any primitive type;

any primitive wrapper type;

String;

System.DateTime;

System.Data.DbType.Date;

System.Decimal;

System.Numerics.BigInteger.

The mapped column for the primary key of the entity is assumed to be the primary key of the primary table. If no Column annotation is specified, the primary key column name is assumed to be the name of the primary key property or field.

Examples

CopyC#
Example:

[Id]
public Long getId() { return id; }

Namespace: NPersistence
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)

Syntax

   
 C# 
public sealed class Id : Attribute

Members

      
 All Members  Constructors  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
Id()()()()
Initializes a new instance of the Id class

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    NPersistence..::..Id

See Also