Class EntityBuilder<T>
Fluent builder for constructing entity manifests.
public sealed class EntityBuilder<T> where T : class
Type Parameters
TThe entity type.
- Inheritance
-
EntityBuilder<T>
- Inherited Members
Constructors
EntityBuilder()
Initializes a new instance of the EntityBuilder<T> class.
public EntityBuilder()
Methods
Key<TProperty>(Expression<Func<T, TProperty>>)
Specifies the primary key property.
public PropertyBuilder<T, TProperty> Key<TProperty>(Expression<Func<T, TProperty>> propertyExpression)
Parameters
propertyExpressionExpression<Func<T, TProperty>>The property selector expression.
Returns
- PropertyBuilder<T, TProperty>
A property builder for further configuration.
Type Parameters
TPropertyThe property type.
Property<TProperty>(Expression<Func<T, TProperty>>)
Specifies a property for configuration.
public PropertyBuilder<T, TProperty> Property<TProperty>(Expression<Func<T, TProperty>> propertyExpression)
Parameters
propertyExpressionExpression<Func<T, TProperty>>The property selector expression.
Returns
- PropertyBuilder<T, TProperty>
A property builder for further configuration.
Type Parameters
TPropertyThe property type.
ToTable(string, string?)
Specifies the table name for the entity.
public EntityBuilder<T> ToTable(string tableName, string? schemaName = null)
Parameters
Returns
- EntityBuilder<T>
The entity builder for chaining.
WithMetadata(string, object?)
Adds metadata to the entity.
public EntityBuilder<T> WithMetadata(string key, object? value)
Parameters
Returns
- EntityBuilder<T>
The entity builder for chaining.