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