Class EntityBaseExtensions
Defines a collection of extensions for the EntityBase type.
Inheritance
System.Object
EntityBaseExtensions
Namespace: MADE.Data.EFCore.Extensions
Assembly: MADE.Data.EFCore.dll
Syntax
public static class EntityBaseExtensions : object
Methods
| Improve this Doc View SourceConfigure<TEntity>(EntityTypeBuilder<TEntity>)
Configures the default properties of an TEntity
.
Declaration
public static EntityTypeBuilder<TEntity> Configure<TEntity>(this EntityTypeBuilder<TEntity> builder)
where TEntity : class, IEntityBase
Parameters
Type | Name | Description |
---|---|---|
EntityTypeBuilder<TEntity> | builder | The entity type builder associated with the entity. |
Returns
Type | Description |
---|---|
EntityTypeBuilder<TEntity> | The entity type builder. |
Type Parameters
Name | Description |
---|---|
TEntity | The type of entity to configure. |
ConfigureDateProperties<TEntity>(EntityTypeBuilder<TEntity>)
Configures the created and updated date properties of an TEntity
as UTC.
Declaration
public static EntityTypeBuilder<TEntity> ConfigureDateProperties<TEntity>(this EntityTypeBuilder<TEntity> builder)
where TEntity : class, IDatedEntity
Parameters
Type | Name | Description |
---|---|---|
EntityTypeBuilder<TEntity> | builder | The entity type builder associated with the entity. |
Returns
Type | Description |
---|---|
EntityTypeBuilder<TEntity> | The entity type builder. |
Type Parameters
Name | Description |
---|---|
TEntity | The type of entity to configure. |
ConfigureWithKey<TEntity, TKey>(EntityTypeBuilder<TEntity>)
Configures the default properties of an TEntity
.
Declaration
public static EntityTypeBuilder<TEntity> ConfigureWithKey<TEntity, TKey>(this EntityTypeBuilder<TEntity> builder)
where TEntity : class, IEntityBase<TKey>
Parameters
Type | Name | Description |
---|---|---|
EntityTypeBuilder<TEntity> | builder | The entity type builder associated with the entity. |
Returns
Type | Description |
---|---|
EntityTypeBuilder<TEntity> | The entity type builder. |
Type Parameters
Name | Description |
---|---|
TEntity | The type of entity to configure. |
TKey | The type of unique identifier for the entity. |