Interface IRepository<T>
Interface for basic repository operations
Namespace: Benday.EfCore.SqlServer
Assembly: Benday.EfCore.SqlServer.dll
Syntax
public interface IRepository<T> where T : IInt32Identity
Type Parameters
Name | Description |
---|---|
T | Entity data type managed by this repository implementation. Must be an instance of IInt32Identity. |
Methods
| Edit this page View SourceDelete(T)
Delete this entity
Declaration
void Delete(T deleteThis)
Parameters
Type | Name | Description |
---|---|---|
T | deleteThis | Entity to delete |
GetAll()
Get all records
Declaration
IList<T> GetAll()
Returns
Type | Description |
---|---|
IList<T> |
GetAll(int, bool)
Get all records with a maximum number of results. Optionally, request that dependent entity references and collections are not populated. ///
Declaration
IList<T> GetAll(int maxNumberOfRows, bool noIncludes = true)
Parameters
Type | Name | Description |
---|---|---|
int | maxNumberOfRows | Maximum number of records to return |
bool | noIncludes | If true, do not include or populate dependent entities |
Returns
Type | Description |
---|---|
IList<T> |
GetById(int)
Get a single entity by id value
Declaration
T? GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | Identity value |
Returns
Type | Description |
---|---|
T | The matching instance of the entity or null if not found. |
Save(T)
Save or update the entity and any children.
Declaration
void Save(T saveThis)
Parameters
Type | Name | Description |
---|---|---|
T | saveThis | Entity to save |