source/Nevermore/Mapping/DocumentMap.cs
/// <summary>
/// Configures the ID of the document.
/// </summary>
/// <param name="columnName">The name of the column that the ID is stored in.</param>
/// <param name="property">An expression that accesses the property. E.g., <code>c => c.FirstName</code></param>
/// <typeparam name="TProperty">The property type of the Id column.</typeparam>
/// <returns>A builder to further configure the ID.</returns>
Configures the ID of the document.
Configures the ID of the document .
protected IColumnMappingBuilder Id<TProperty>(string columnName, Expression<Func<TDocument, TProperty>> property)
        {
            var prop = GetPropertyInfo(property)
                ?? throw new Exception("The expression for the Id column must be a property.");
            map.IdColumn = new ColumnMapping(columnName ?? prop.Name, typeof(TProperty), new PropertyHandler(prop), prop);
            return map.IdColumn;
        }
protected IColumnMappingBuilder Id < TProperty > ( string columnName , Expression < Func < TDocument , TProperty > > property ) { var prop = GetPropertyInfo ( property ) ?? throw new Exception ( " " ) ; map . IdColumn = new ColumnMapping ( columnName ?? prop . Name , typeof ( TProperty ) , new PropertyHandler ( prop ) , prop ) ; return map . IdColumn ; }
Configures the ID of the document.
Configures the ID of the document .
A builder to further configure the ID.
A builder to further configure the ID .
columnName
string
The name of the column that the ID is stored in.
The name of the column that the ID is stored in .
property
Expression<Func<TDocument, TProperty>>
An expression that accesses the property. E.g., c => c.FirstName
An expression that accesses the property . E . g . c = > c . FirstName
typeparam
The property type of the Id column.
The property type of the Id column .