NPersistence Reference Guide
Specifies the enum type for a map key whose basic type is an enumerated type.

The MapKeyEnumerated annotation can be applied to an element collection or relationship of type System.Collections.Generic.Dictionary, in conjunction with the ElementCollection, OneToMany, or ManyToMany annotation.

If the enumerated type is not specified or the MapKeyEnumerated annotation is not used, the enumerated type is assumed to be ORDINAL.

Examples

CopyC#
Example:

public enum ProjectStatus {COMPLETE, DELAYED, CANCELLED, IN_PROGRESS}

public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}

[Entity] public class Employee {
    [ManyToMany] 
    public Projects<ProjectStatus, Project> getProjects() {...}

    [OneToMany]
    [MapKeyEnumerated(STRING)]
    public Dictionary<SalaryRate, Employee> getEmployees() {...}
    ...
}

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

Syntax

   
 C# 
public sealed class MapKeyEnumerated : Attribute

Members

         
 All Members  Constructors   Fields  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
MapKeyEnumerated()()()()
Initializes a new instance of the MapKeyEnumerated class
MapKeyEnumerated(EnumType)
Initializes a new instance of the MapKeyEnumerated class
Value
(Optional) The type used in mapping a map key enum type.

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    NPersistence..::..MapKeyEnumerated

See Also