Skip to main content

IRepository<TEntity, TPrimaryKey> Members

The IRepository interface represents the read and write implementation of the Repository pattern such that it can be used to query entities of a given type.

Properties

Name Description
ElementType Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQueryable is executed. Inherited from IQueryable.
Expression Gets the expression tree that is associated with the instance of IQueryable. Inherited from IQueryable.
GetPrimaryKeyExpression Gets the lambda-expression that returns the entity primary key.
Provider Gets the query provider that is associated with this data source. Inherited from IQueryable.
UnitOfWork The owner unit of work. Inherited from IReadOnlyRepository<TEntity>.

Methods

Name Description
Add(TEntity) Marks the given entity as Added such that it will be commited to the store when IUnitOfWork.SaveChanges is called.
Create(Boolean) Creates a new instance of the entity type.
Find(TPrimaryKey) Finds an entity with the given primary key value.
GetEnumerator() Returns an enumerator that iterates through the collection. Inherited from IEnumerable<T>.
GetPrimaryKey(TEntity) Returns the primary key value for the entity.
GetState(TEntity) Returns the state of the given entity.
HasPrimaryKey(TEntity) Determines whether the given entity has the primary key assigned (the primary key is not null).
Include<TProperty>(Expression<Func<T, TProperty>>) Specifies the related objects to include in the query results. Inherited from IRepositoryQuery<T>.
Reload(TEntity) Reloads the entity from the store overwriting any property values with values from the store and returns a reloaded entity.
Remove(TEntity) Marks the given entity as EntityState.Deleted such that it will be deleted from the store when IUnitOfWork.SaveChanges is called.
SetPrimaryKey(TEntity, TPrimaryKey) Assigns the given primary key value to a given entity.
Update(TEntity) Changes the state of the specified entity to EntityState.Modified if changes are not automatically tracked by the implementation.
Where(Expression<Func<T, Boolean>>) Filters a sequence of entities based on the given predicate. Inherited from IRepositoryQuery<T>.
See Also