IndexAnnotation Class

 

Represents the custom annotations for representing database indexes in an Entity Framework model.

Namespace:   System.Data.Entity.Infrastructure.Annotations
Assembly:  EntityFramework (in EntityFramework.dll)

System.Object
  System.Data.Entity.Infrastructure.Annotations.IndexAnnotation

public class IndexAnnotation : IMergeableAnnotation

NameDescription
System_CAPS_pubmethodIndexAnnotation(IEnumerable<IndexAttribute>)

Initializes a new instance of the IndexAnnotation class using the given collection of indexes.

System_CAPS_pubmethodIndexAnnotation(IndexAttribute)

Initializes a new instance of the IndexAnnotation class using the given collection of indexes.

NameDescription
System_CAPS_pubpropertyIndexes

Gets the indexes represented by this annotation.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsCompatibleWith(Object)

Returns true if this annotation does not conflict with the given annotation such that the two can be combined together using the MergeWith method.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodMergeWith(Object)

Merges this annotation with the given annotation and returns a new annotation containing the merged indexes.

System_CAPS_pubmethodToString()

Returns a string representation of the IndexAnnotation object.(Overrides Object.ToString().)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticAnnotationName

The name used when this annotation is stored in Entity Framework metadata or serialized into an SSDL/EDMX file.

An index annotation is added to a Code First model when an IndexAttribute is placed on a mapped property of that model. This is used by Entity Framework Migrations to create indexes on mapped database columns. Note that multiple index attributes on a property will be merged into a single annotation for the column. Similarly, index attributes on multiple properties that map to the same column will be merged into a single annotation for the column. This means that one index annotation can represent multiple indexes. Within an annotation there can be only one index with any given name.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.