Table of Contents

Class DbContextEntityService<T, TEntityInterface, TDbContext>

Namespace
Innova.Data.Entity
Assembly
Innova.Data.dll
public class DbContextEntityService<T, TEntityInterface, TDbContext> : IEntityService<T> where T : class where TEntityInterface : class where TDbContext : DbContext

Type Parameters

T
TEntityInterface
TDbContext
Inheritance
DbContextEntityService<T, TEntityInterface, TDbContext>
Implements
Derived
Extension Methods

Constructors

DbContextEntityService(IEntitySecurity<T>, IEntityValidationService<T, TEntityInterface>, ISelectorFactory, IEntityFactory<T>, IQueryModifier<T>, IDbContextFactory<TDbContext>)

Initializes a new instance of the DbContextEntityService<T, TEntityInterface, TDbContext> class.

Properties

DbContextFactory

Represents a factory for creating instances of the database context.

EntityFactory

Represents a factory for creating entities.

EntitySecurity

Gets or sets the entity security for the DbContextEntityService.

EntityValidationService

Represents a service for validating entities.

QueryModifier

Represents a modifier for query operations.

SelectorFactory

Represents a factory for creating selectors.

Methods

Can(Operation, T, object)

Checks if the specified operation can be performed and throws a warning if not.

CanThrowWarningIfNot(Operation, IPrimaryKey)

Checks if the specified operation can be performed and throws a warning if not.

CanThrowWarningIfNot(Operation, T)

Checks if the specified operation can be performed and throws a warning if not.

Can<TOther>(Operation, TOther)

Checks if the specified operation can be performed for the given entity.

Count(QueryParameter<T>, CancellationToken)

Retrieves the count of entities from the database based on the provided query parameters.

Create()

Creates a new entity with the default property values.

Create(IPropertyValues)

Creates a new entity with the provided property values.

Create(IPropertyValues, CancellationToken)

Creates a new entity with the provided property values.

Create<TInsert>(IPropertyValues)

Creates a new entity with the provided property values.

Delete(List<IPrimaryKey>, CancellationToken)

Deletes a list of entities from the database based on the provided primary keys.

Get(IPrimaryKey, CancellationToken)

Retrieves a single entity from the database based on the provided primary keys.

GetKeys(QueryParameter<T>, CancellationToken)

Retrieves the primary keys of entities from the database based on the provided query parameters.

GetList(QueryParameter<T>, CancellationToken)

Retrieves a list of entities from the database based on the provided query parameters.

GetListForLookup(CancellationToken)

Retrieves a list of entities from the database for lookup purposes.

Get<TResult>(IPrimaryKey, CancellationToken)

Retrieves a single entity from the database based on the provided primary keys.

Get<TResult>(IPropertyValues, CancellationToken)

Retrieves a single entity from the database based on the provided property values.

Insert(List<T>, CancellationToken)

Inserts a list of entities into the database.

InsertToDatabase(List<T>, CancellationToken)

Inserts a list of entities into the database.

MapAndPermissionCheck<TResult>(Operation, List<TResult>)

Maps the provided entities to type T and performs permission check for the specified operation.

MapAndPermissionCheck<TResult>(ValidationRuleSetEnum, List<TResult>)

Maps the provided entities to type T and performs permission check for the specified operation.

ToListDistinct<TValue>(Expression<Func<T, TValue>>, Expression<Func<T, bool>>, CancellationToken)

Retrieves a distinct list of values from the database based on the provided selector and optional where clause.

Update(List<T>, CancellationToken)

Updates a list of entities in the database.

UpdateToDatabase(List<T>, CancellationToken)

Updates a list of entities in the database.

ValidateAndMapAndPermissionCheck<TResult>(ValidationRuleSetEnum, List<TResult>, CancellationToken)

Validates the entities and performs permission check based on the provided validation rule set.

ValidateAndPermissionCheck(ValidationRuleSetEnum, List<T>, CancellationToken)

Validates the entities and performs permission check based on the provided validation rule set.

ValidatePrimaryKeysAndCreateEntity(IPrimaryKey)

Validates the primary keys and creates an entity based on the provided primary keys.