Class MaybeEntityTypeBuilderExtensions
- Namespace
- Trellis.EntityFrameworkCore
- Assembly
- Trellis.EntityFrameworkCore.dll
Entity type builder helpers that resolve Maybe<T> properties to their mapped storage members.
public static class MaybeEntityTypeBuilderExtensions
- Inheritance
-
MaybeEntityTypeBuilderExtensions
- Inherited Members
Methods
HasTrellisIndex<TEntity>(EntityTypeBuilder<TEntity>, Expression<Func<TEntity, object?>>)
Creates an index using CLR property selectors while automatically translating any Maybe<T> properties to their field-only EF Core mappings.
public static IndexBuilder<TEntity> HasTrellisIndex<TEntity>(this EntityTypeBuilder<TEntity> entityTypeBuilder, Expression<Func<TEntity, object?>> propertySelector) where TEntity : class
Parameters
entityTypeBuilderEntityTypeBuilder<TEntity>The entity type builder.
propertySelectorExpression<Func<TEntity, object>>A single property selector or anonymous object of property selectors. Example:
e => e.Phoneore => new { e.Status, e.SubmittedAt }.
Returns
- IndexBuilder<TEntity>
The index builder for additional configuration.
Type Parameters
TEntityThe entity type.
Exceptions
- InvalidOperationException
Thrown when a Maybe<T> selector resolves to a storage member that neither exists on the CLR type nor is already mapped in the EF model.