Table of Contents

Class ModelBuilderExtension

Namespace
Tlabs.Data.Store
Assembly
Tlabs.EfDataStore.dll

Model builder extension.

public static class ModelBuilderExtension
Inheritance
ModelBuilderExtension
Inherited Members

Remarks

Supports schema scoped entity model configuration:

public void ConfigureModel(ModelBuilder modelConfig) {
modelConfig.Schema("Identity", modBuilder => {
modelConfig.Entity<User>(userBuilder => { .. });
});
...
}

Methods

DocEntity<TDocEntity, TBody>(ref SchemaScopedModelBuilder, Action<EntityTypeBuilder<TDocEntity>>)

Configure document entity of type TDocEntity and TBody type with ModelBuilderExtension.SchemaScopedModelBuilder.

public static ref ModelBuilderExtension.SchemaScopedModelBuilder DocEntity<TDocEntity, TBody>(this ref ModelBuilderExtension.SchemaScopedModelBuilder bld, Action<EntityTypeBuilder<TDocEntity>> buildAction) where TDocEntity : BaseDocument<TDocEntity> where TBody : BaseDocument<TDocEntity>.BodyData

Parameters

bld ModelBuilderExtension.SchemaScopedModelBuilder
buildAction Action<EntityTypeBuilder<TDocEntity>>

Returns

ModelBuilderExtension.SchemaScopedModelBuilder

Type Parameters

TDocEntity
TBody

Entity<T>(ModelBuilder, string, Action<EntityTypeBuilder<T>>)

Configure entity of type T with schema in the model.

public static ModelBuilder Entity<T>(this ModelBuilder bld, string schema, Action<EntityTypeBuilder<T>> buildAction) where T : class

Parameters

bld ModelBuilder
schema string
buildAction Action<EntityTypeBuilder<T>>

Returns

ModelBuilder

Type Parameters

T

Entity<T>(ref SchemaScopedModelBuilder, Action<EntityTypeBuilder<T>>)

Configure entity of type T with ModelBuilderExtension.SchemaScopedModelBuilder.

public static ref ModelBuilderExtension.SchemaScopedModelBuilder Entity<T>(this ref ModelBuilderExtension.SchemaScopedModelBuilder bld, Action<EntityTypeBuilder<T>> buildAction) where T : class

Parameters

bld ModelBuilderExtension.SchemaScopedModelBuilder
buildAction Action<EntityTypeBuilder<T>>

Returns

ModelBuilderExtension.SchemaScopedModelBuilder

Type Parameters

T

Schema(ModelBuilder, string, Action<SchemaScopedModelBuilder>)

Start a schema scope for modelBuilderAction.

public static ModelBuilder Schema(this ModelBuilder bld, string schema, Action<ModelBuilderExtension.SchemaScopedModelBuilder> modelBuilderAction)

Parameters

bld ModelBuilder
schema string
modelBuilderAction Action<ModelBuilderExtension.SchemaScopedModelBuilder>

Returns

ModelBuilder