Interface IRepository
- Namespace
- Songhay.Abstractions
- Assembly
- SonghayCore.dll
Defines the repository pattern for an Entity.
public interface IRepository
- Extension Methods
Remarks
Based on the NBlog repository by Chris Fulstow [https://github.com/ChrisFulstow/NBlog/blob/master/NBlog.Web/Application/Storage/IRepository.cs]
Methods
DeleteEntity<TEntity>(object?)
Deletes the entity.
void DeleteEntity<TEntity>(object? key) where TEntity : class, new()
Parameters
key
objectThe key.
Type Parameters
TEntity
The type of the entity.
HasEntity<TEntity>(object?)
Determines whether the specified key has entity.
bool HasEntity<TEntity>(object? key) where TEntity : class, new()
Parameters
key
objectThe key.
Returns
Type Parameters
TEntity
The type of the entity.
LoadAll<TEntity>()
Loads all.
IEnumerable<TEntity?> LoadAll<TEntity>() where TEntity : class, new()
Returns
- IEnumerable<TEntity>
Type Parameters
TEntity
The type of the entity.
LoadSingle<TEntity>(object?)
Loads the single.
TEntity? LoadSingle<TEntity>(object? key) where TEntity : class, new()
Parameters
key
objectThe key.
Returns
- TEntity
Type Parameters
TEntity
The type of the entity.
SaveEntity<TEntity>(TEntity?)
Saves the entity.
void SaveEntity<TEntity>(TEntity? item) where TEntity : class, new()
Parameters
item
TEntityThe item.
Type Parameters
TEntity
The type of the entity.