source/Nevermore/Mapping/DocumentMap.cs
/// <summary>
/// Defines a column that will be used to resolve the type of object to create. Nevermore will then locate an
/// <see cref="IInstanceTypeResolver"/> that can resolve concrete instances of that type based on the value
/// in this column.
/// </summary>
/// <param name="columnName">The name of the column that the property will be 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 column.</typeparam>
/// <returns>A builder to further configure the column mapping.</returns>
Defines a column that will be used to resolve the type of object to create. Nevermore will then locate an
that can resolve concrete instances of that type based on the value
in this column.
Defines a column that will be used to resolve the type of object to create . Nevermore will then locate an that can resolve concrete instances of that type based on the value in this column .
protected IColumnMappingBuilder TypeResolutionColumn<TProperty>(string columnName, Expression<Func<TDocument, TProperty>> property)
        {
            var prop = GetPropertyInfo(property)
                       ?? throw new Exception("The expression for the Type Resolution column must be a property.");
            map.TypeResolutionColumn = new ColumnMapping(columnName ?? prop.Name, typeof(TProperty), new PropertyHandler(prop), prop);
            map.Columns.Add(map.TypeResolutionColumn);
            return map.TypeResolutionColumn; 
        }
protected IColumnMappingBuilder TypeResolutionColumn < TProperty > ( string columnName , Expression < Func < TDocument , TProperty > > property ) { var prop = GetPropertyInfo ( property ) ?? throw new Exception ( " " ) ; map . TypeResolutionColumn = new ColumnMapping ( columnName ?? prop . Name , typeof ( TProperty ) , new PropertyHandler ( prop ) , prop ) ; map . Columns . Add ( map . TypeResolutionColumn ) ; return map . TypeResolutionColumn ; }
Defines a column that will be used to resolve the type of object to create.
Defines a column that will be used to resolve the type of object to create .
A builder to further configure the column mapping.
A builder to further configure the column mapping .
columnName
string
The name of the column that the property will be stored in.
The name of the column that the property will be 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 column.
The property type of the column .