ReplicaMetadata.FindItemMetadataByUniqueIndexedField Method

When overridden in a derived class, returns the unique item metadata entry that has the specified value for the indexed field.

Namespace: Microsoft.Synchronization.MetadataStorage
Assembly: Microsoft.Synchronization.MetadataStorage (in microsoft.synchronization.metadatastorage.dll)

Syntax

'Declaration
Public MustOverride Function FindItemMetadataByUniqueIndexedField ( _
    fieldName As String, _
    fieldValue As Object _
) As ItemMetadata
'Usage
Dim instance As ReplicaMetadata
Dim fieldName As String
Dim fieldValue As Object
Dim returnValue As ItemMetadata

returnValue = instance.FindItemMetadataByUniqueIndexedField(fieldName, fieldValue)
public abstract ItemMetadata FindItemMetadataByUniqueIndexedField (
    string fieldName,
    Object fieldValue
)
public:
virtual ItemMetadata^ FindItemMetadataByUniqueIndexedField (
    String^ fieldName, 
    Object^ fieldValue
) abstract
public abstract ItemMetadata FindItemMetadataByUniqueIndexedField (
    String fieldName, 
    Object fieldValue
)
public abstract function FindItemMetadataByUniqueIndexedField (
    fieldName : String, 
    fieldValue : Object
) : ItemMetadata

Parameters

  • fieldName
    The name of the unique indexed field. The field must be a valid field and a unique index field.
  • fieldValue
    The value of the unique indexed field.

Return Value

The unique metadata entry that has the specified value for the indexed field. A null reference (Nothing in Visual Basic) is returned when no item exists.

Exceptions

Exception type Condition

ObjectDisposedException

The object has been disposed or was not initialized correctly.

ArgumentNullException

fieldName or fieldValue is a null reference (Nothing in Visual Basic).

ArgumentException

fieldName is 0 length, or fieldValue is both a string type and 0 length.

NotSupportedException

fieldValue is of an unsupported type.

MetadataFieldNotFoundException

fieldName was not found or is not valid.

MetadataStoreInvalidOperationException

The specified field is not a unique index.

Remarks

Custom fields must be established when the replica metadata is first initialized by passing FieldSchema to InitializeReplicaMetadata.

Index fields must be established and marked as unique when the replica metadata is first initialized by passing IndexSchema to InitializeReplicaMetadata.

See Also

Reference

ReplicaMetadata Class
ReplicaMetadata Members
Microsoft.Synchronization.MetadataStorage Namespace