Table of Contents

Class EntityBuilder<T>

Namespace
JD.Domain.Modeling
Assembly
JD.Domain.Modeling.dll

Fluent builder for constructing entity manifests.

public sealed class EntityBuilder<T> where T : class

Type Parameters

T

The 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

propertyExpression Expression<Func<T, TProperty>>

The property selector expression.

Returns

PropertyBuilder<T, TProperty>

A property builder for further configuration.

Type Parameters

TProperty

The 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

propertyExpression Expression<Func<T, TProperty>>

The property selector expression.

Returns

PropertyBuilder<T, TProperty>

A property builder for further configuration.

Type Parameters

TProperty

The property type.

ToTable(string, string?)

Specifies the table name for the entity.

public EntityBuilder<T> ToTable(string tableName, string? schemaName = null)

Parameters

tableName string

The table name.

schemaName string

The optional schema name.

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

key string

The metadata key.

value object

The metadata value.

Returns

EntityBuilder<T>

The entity builder for chaining.