dcpddd  1.0.4
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T > Class Template Reference

Base repository (Entity Framework) More...

Inheritance diagram for dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >:
dcp.DDD.DomainModel.SuperTypes.IRepository< T >

Public Member Functions

IEnumerable< T > GetAll ()
 Returns all entites More...
 
virtual T Find (params object[] keyValues)
 Finds single entity by key values More...
 
Find (object[] keyValues, IEnumerable< Expression< Func< T, object >>> includePaths)
 Finds single entity by key values, eager loads related entities More...
 
Find (object keyValue, IEnumerable< Expression< Func< T, object >>> includePaths)
 Finds single entity by key value, eager loads related entities More...
 
Find (object keyValue, params Expression< Func< T, object >>[] includePaths)
 Finds single entity by key values, eager loads related entities More...
 
TR Find< TR > (object[] keyValues, Expression< Func< T, TR >> projection)
 Finds single entity by key values and retutns entity projection More...
 
TR Find< TR > (object keyValue, Expression< Func< T, TR >> projection)
 Finds single entity by key value and returns entity projection More...
 
TR Find< TR > (object[] keyValues, Expression< Func< T, TR >> projection, IEnumerable< Expression< Func< T, object >>> includePaths)
 Finds single entity by key values, eager loads related entities and returns entity projection More...
 
TR Find< TR > (object keyValue, Expression< Func< T, TR >> projection, params Expression< Func< T, object >>[] includePaths)
 Finds single entity by single key value, eager loads related entities and returns enity projection More...
 
IEnumerable< T > FindBy (IQueryCommand< T > queryObject)
 Finds entities satisfied with query command More...
 
IEnumerable< TR > FindBy< TR > (IQueryCommand< T > queryObject, Expression< Func< T, TR >> projection)
 Finds entities satisfied with predicate More...
 
IEnumerable< TR > FindBy< TR > (IQueryCommand< T > queryObject, Expression< Func< T, TR >> projection, IEnumerable< Expression< Func< T, object >>> includePaths)
 Finds entities satisfied with query command, eager loads related entities and returns entity projections More...
 
IEnumerable< TR > FindBy< TR > (IQueryCommand< T > queryObject, Expression< Func< T, TR >> projection, params Expression< Func< T, object >>[] includePaths)
 Finds entities satisfied with query command, eager loads related entities and returns entity projections More...
 
int CountBy (IQueryCommand< T > queryObject)
 Gets count of entities satisfied with query command More...
 
bool AnyBy (IQueryCommand< T > queryObject)
 Checks if elements satisfied with query are exists More...
 
int CountBy (Expression< Func< T, bool >> predicate)
 Gets count of entities satisfied with query predicate More...
 
bool AnyBy (Expression< Func< T, bool >> predicate)
 Checks if entites satisfied with query predicate are exists More...
 
Remove (T entity)
 Remove entity More...
 
void Remove (params object[] keyValues)
 Remove entity by keyValues More...
 
IEnumerable< T > RemoveRange (IEnumerable< T > entities)
 Remove range of entities More...
 
IEnumerable< T > AddRange (IEnumerable< T > entities)
 Add range of entities More...
 
IEnumerable< T > FindBy (Expression< Func< T, bool >> predicate)
 Finds entities satisfied with predicate More...
 
IEnumerable< TR > FindBy< TR > (Expression< Func< T, bool >> predicate, Expression< Func< T, TR >> projection)
 Finds entities satisfied with predicate More...
 
IEnumerable< TR > FindBy< TR > (Expression< Func< T, bool >> predicate, Expression< Func< T, TR >> projection, IEnumerable< Expression< Func< T, object >>> includePaths)
 Finds entities satisfied with predicate, eager loads related entities and returns entity projections More...
 
IEnumerable< TR > FindBy< TR > (Expression< Func< T, bool >> predicate, Expression< Func< T, TR >> projection, params Expression< Func< T, object >>[] includePaths)
 Finds entities satisfied with predicate, eager loads related entities and returns entity projections More...
 
Add (T entity)
 Adds entity to repository More...
 

Protected Member Functions

 RepositoryBase (IUnitOfWork unitOfWork, params Expression< Func< T, object >>[] keys)
 Constructor More...
 

Protected Attributes

readonly DbContext Context
 
readonly DbSet< T > Set
 
readonly ObjectContext ObjectContext
 
readonly ObjectSet< T > ObjectSet
 

Detailed Description

Base repository (Entity Framework)

Template Parameters
T
Type Constraints
T :class 

Constructor & Destructor Documentation

dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.RepositoryBase ( IUnitOfWork  unitOfWork,
params Expression< Func< T, object >>[]  keys 
)
protected

Constructor

Parameters
unitOfWorkUnit of work
keysPrimary keys of entity

Member Function Documentation

Adds entity to repository

Parameters
entityEntity
Returns
Entity

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<T> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.AddRange ( IEnumerable< T >  entities)

Add range of entities

Parameters
entitiesEntities
Returns
Entities

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

Checks if elements satisfied with query are exists

Parameters
queryObjectQuery
Returns
Is any

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

bool dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.AnyBy ( Expression< Func< T, bool >>  predicate)

Checks if entites satisfied with query predicate are exists

Parameters
predicateQuery predicate
Returns
Is Any

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

Gets count of entities satisfied with query command

Parameters
queryObjectQuery command
Returns
Count

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

int dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.CountBy ( Expression< Func< T, bool >>  predicate)

Gets count of entities satisfied with query predicate

Parameters
predicateQuery predicate
Returns
Count

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

virtual T dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find ( params object[]  keyValues)
virtual

Finds single entity by key values

Parameters
keyValuesKey values
Returns
Entity

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

Reimplemented in dcp.DDD.Infrastructure.Data.EF.SuperTypes.AdaptedRepositoryBase< TData, TDomain >.

T dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find ( object[]  keyValues,
IEnumerable< Expression< Func< T, object >>>  includePaths 
)

Finds single entity by key values, eager loads related entities

Parameters
keyValuesKey values
includePathsPaths of related entites
Returns
Entity

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

T dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find ( object  keyValue,
IEnumerable< Expression< Func< T, object >>>  includePaths 
)

Finds single entity by key value, eager loads related entities

Parameters
keyValueKey value
includePathsPaths of related entites
Returns
Entity

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

T dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find ( object  keyValue,
params Expression< Func< T, object >>[]  includePaths 
)

Finds single entity by key values, eager loads related entities

Use only when single include path

Parameters
keyValueKey values
includePathsPaths of related entites
Returns
Entity

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

TR dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find< TR > ( object[]  keyValues,
Expression< Func< T, TR >>  projection 
)

Finds single entity by key values and retutns entity projection

Template Parameters
TREntity projection
Parameters
keyValuesKey values
projectionFactory of entity projection
Returns
Entity projection

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

TR dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find< TR > ( object  keyValue,
Expression< Func< T, TR >>  projection 
)

Finds single entity by key value and returns entity projection

Template Parameters
TREntity projection
Parameters
keyValueKey value
projectionFactory of entity projection
Returns
Entity projection

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

TR dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find< TR > ( object[]  keyValues,
Expression< Func< T, TR >>  projection,
IEnumerable< Expression< Func< T, object >>>  includePaths 
)

Finds single entity by key values, eager loads related entities and returns entity projection

Template Parameters
TREntity projection
Parameters
keyValuesKey values
projectionFactory of entity projection
includePathsPaths of related entites
Returns
Entity projection

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

TR dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Find< TR > ( object  keyValue,
Expression< Func< T, TR >>  projection,
params Expression< Func< T, object >>[]  includePaths 
)

Finds single entity by single key value, eager loads related entities and returns enity projection

Template Parameters
TREntity projection
Parameters
keyValueKey value
projectionFactory of entity projection
includePathsPaths of related entites
Returns
Entity projection

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<T> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy ( IQueryCommand< T >  queryObject)

Finds entities satisfied with query command

Parameters
queryObjectQuery command
Returns
Entites

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<T> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy ( Expression< Func< T, bool >>  predicate)

Finds entities satisfied with predicate

Parameters
predicateQuery predicate
Returns
Entites

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<TR> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy< TR > ( IQueryCommand< T >  queryObject,
Expression< Func< T, TR >>  projection 
)

Finds entities satisfied with predicate

Template Parameters
TREntity projection
Parameters
queryObjectQuery command
projectionFactory of entity projection
Returns
Entity projections

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<TR> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy< TR > ( IQueryCommand< T >  queryObject,
Expression< Func< T, TR >>  projection,
IEnumerable< Expression< Func< T, object >>>  includePaths 
)

Finds entities satisfied with query command, eager loads related entities and returns entity projections

Template Parameters
TREntity projection
Parameters
queryObjectQuery command
projectionFactory of entity projection
includePathsPaths of related entites
Returns
Entity projections

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<TR> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy< TR > ( IQueryCommand< T >  queryObject,
Expression< Func< T, TR >>  projection,
params Expression< Func< T, object >>[]  includePaths 
)

Finds entities satisfied with query command, eager loads related entities and returns entity projections

Template Parameters
TREntity projection
Parameters
queryObjectQuery command
projectionFactory of entity projection
includePathsPaths of related entites
Returns
Entity projections

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<TR> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy< TR > ( Expression< Func< T, bool >>  predicate,
Expression< Func< T, TR >>  projection 
)

Finds entities satisfied with predicate

Template Parameters
TREntity projection
Parameters
predicateQuery predicate
projectionFactory of entity projection
Returns
Entites projetions

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<TR> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy< TR > ( Expression< Func< T, bool >>  predicate,
Expression< Func< T, TR >>  projection,
IEnumerable< Expression< Func< T, object >>>  includePaths 
)

Finds entities satisfied with predicate, eager loads related entities and returns entity projections

Template Parameters
TREntity projection
Parameters
predicateQuery predicate
projectionFactory of entity projection
includePathsPaths of related entites
Returns
Entites projetions

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<TR> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.FindBy< TR > ( Expression< Func< T, bool >>  predicate,
Expression< Func< T, TR >>  projection,
params Expression< Func< T, object >>[]  includePaths 
)

Finds entities satisfied with predicate, eager loads related entities and returns entity projections

Template Parameters
TREntity projection
Parameters
predicateQuery predicate
projectionFactory of entity projection
includePathsPaths of related entites
Returns
Entites projetions

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

Returns all entites

Returns
Entities

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

Remove entity

Parameters
entityEntity
Returns
Entity

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

void dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Remove ( params object[]  keyValues)

Remove entity by keyValues

Parameters
keyValuesKey values

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

IEnumerable<T> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.RemoveRange ( IEnumerable< T >  entities)

Remove range of entities

Parameters
entitiesEntities
Returns
Entities

Implements dcp.DDD.DomainModel.SuperTypes.IRepository< T >.

Member Data Documentation

readonly DbContext dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Context
protected
readonly ObjectContext dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.ObjectContext
protected
readonly ObjectSet<T> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.ObjectSet
protected
readonly DbSet<T> dcp.DDD.Infrastructure.Data.EF.SuperTypes.RepositoryBase< T >.Set
protected

The documentation for this class was generated from the following file: