Interface IRepository<TKey, TEntity>
- Namespace
- BSGameLib.Server
- Assembly
- BSGameLib.Server.dll
Stores entities of type TEntity, keyed by TKey.
public interface IRepository<TKey, TEntity> where TKey : struct, IEquatable<TKey> where TEntity : class, IIdentifiable<TKey>
Type Parameters
TKeyTEntity
Methods
Create(TEntity)
Adds entity to the store.
void Create(TEntity entity)
Parameters
entityTEntity
Delete(TKey)
Removes the entity with entityId.
void Delete(TKey entityId)
Parameters
entityIdTKey
Delete(TEntity)
Removes entity from the store.
void Delete(TEntity entity)
Parameters
entityTEntity
GetAll()
Returns every entity in the store.
IEnumerable<TEntity> GetAll()
Returns
- IEnumerable<TEntity>
GetById(TKey)
Returns the entity with entityId.
TEntity GetById(TKey entityId)
Parameters
entityIdTKey
Returns
- TEntity
Update(TEntity)
Saves the changes made to entity.
void Update(TEntity entity)
Parameters
entityTEntity