Class AccountRepository
Class that represents an accounts repository.
Inheritance
Implements
Inherited Members
Namespace: Fibula.Data.Repositories
Assembly: Fibula.Data.dll
Syntax
public class AccountRepository : GenericRepository<AccountEntity>, IReadOnlyRepository<AccountEntity>, IRepository<IAccountEntity>, IReadOnlyRepository<IAccountEntity>
Constructors
| Improve this Doc View SourceAccountRepository(DbContext)
Initializes a new instance of the AccountRepository class.
Declaration
public AccountRepository(DbContext context)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.EntityFrameworkCore.DbContext | context | The context to initialize the repository with. |
Methods
| Improve this Doc View SourceAdd(IAccountEntity)
Adds an account to the set in the context.
Declaration
public void Add(IAccountEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IAccountEntity | entity | The account to add. |
AddRange(IEnumerable<IAccountEntity>)
Adds a range of accounts to the set in the context.
Declaration
public void AddRange(IEnumerable<IAccountEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IAccountEntity> | entities | The account range to add. |
FindMany(Expression<Func<IAccountEntity, Boolean>>)
Finds all the entities in the set within the context that satisfy an expression.
Declaration
public IEnumerable<IAccountEntity> FindMany(Expression<Func<IAccountEntity, bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<IAccountEntity, System.Boolean>> | predicate | The expression to satisfy. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IAccountEntity> | The collection of entities retrieved. |
FindOne(Expression<Func<IAccountEntity, Boolean>>)
Finds an account in the set within the context that satisfies an expression. If more than one account satisfies the expression, one is picked up in an unknown criteria.
Declaration
public IAccountEntity FindOne(Expression<Func<IAccountEntity, bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<IAccountEntity, System.Boolean>> | predicate | The expression to satisfy. |
Returns
Type | Description |
---|---|
IAccountEntity | The account found. |
Remove(IAccountEntity)
Removes an entity from the set in the context.
Declaration
public void Remove(IAccountEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IAccountEntity | entity | The entity to remove. |
RemoveRange(IEnumerable<IAccountEntity>)
Removes multiple entities from the repository.
Declaration
public void RemoveRange(IEnumerable<IAccountEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IAccountEntity> | entities | The entities to remove. |
Explicit Interface Implementations
| Improve this Doc View SourceIReadOnlyRepository<IAccountEntity>.GetAll()
Gets all the entities from the set in the context.
Declaration
IEnumerable<IAccountEntity> IReadOnlyRepository<IAccountEntity>.GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IAccountEntity> | The collection of entities retrieved. |
IReadOnlyRepository<IAccountEntity>.GetById(String)
Gets an entity that matches an id, from the context.
Declaration
IAccountEntity IReadOnlyRepository<IAccountEntity>.GetById(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The id to match. |
Returns
Type | Description |
---|---|
IAccountEntity | The entity found, if any. |