Interface IReadOnlyRepository<TEntity>
Interface for a generic, read-only entity repository.
Namespace: Fibula.Data.Contracts.Abstractions
Assembly: Fibula.Data.Contracts.dll
Syntax
public interface IReadOnlyRepository<TEntity>
where TEntity : IIdentifiableEntity
Type Parameters
Name | Description |
---|---|
TEntity | The entity type. |
Methods
| Improve this Doc View SourceFindMany(Expression<Func<TEntity, Boolean>>)
Finds all entities that match a predicate.
Declaration
IEnumerable<TEntity> FindMany(Expression<Func<TEntity, bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TEntity, System.Boolean>> | predicate | The predicate to use for matching. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TEntity> | The entities that matched the predicate. |
FindOne(Expression<Func<TEntity, Boolean>>)
Finds an entity in the set within the context that satisfies an expression. If more than one entity satisfies the expression, one is picked up in an unknown criteria.
Declaration
TEntity FindOne(Expression<Func<TEntity, bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TEntity, System.Boolean>> | predicate | The expression to satisfy. |
Returns
Type | Description |
---|---|
TEntity | The entity found. |
GetAll()
Gets a collection of all entities from a type.
Declaration
IEnumerable<TEntity> GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TEntity> | The collection of entities. |
GetById(String)
Gets a single entity matching the id supplied.
Declaration
TEntity GetById(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The id to search the entity by. |
Returns
Type | Description |
---|---|
TEntity | The entity that matched the id supplied. |