You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Session: How to Customize the Identity Property Lookup for Entities

The client must know which property of your entity is considered as an identity. By default, it always looks for the id field (case-sensitive). This behavior can be changed by overwriting one of our conventions called identityProperty.

Syntax

store.conventions.identityProperty;

Example

Here's how to change it to Identifier field.

store.conventions.identityProperty = "Identifier";