Table of Contents

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

TKey
TEntity

Methods

Create(TEntity)

Adds entity to the store.

void Create(TEntity entity)

Parameters

entity TEntity

Delete(TKey)

Removes the entity with entityId.

void Delete(TKey entityId)

Parameters

entityId TKey

Delete(TEntity)

Removes entity from the store.

void Delete(TEntity entity)

Parameters

entity TEntity

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

entityId TKey

Returns

TEntity

Update(TEntity)

Saves the changes made to entity.

void Update(TEntity entity)

Parameters

entity TEntity