Show / Hide Table of Contents

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 Source

Delete(T)

Delete this entity

Declaration
void Delete(T deleteThis)
Parameters
Type Name Description
T deleteThis

Entity to delete

| Edit this page View Source

GetAll()

Get all records

Declaration
IList<T> GetAll()
Returns
Type Description
IList<T>
| Edit this page View Source

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>
| Edit this page View Source

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.

| Edit this page View Source

Save(T)

Save or update the entity and any children.

Declaration
void Save(T saveThis)
Parameters
Type Name Description
T saveThis

Entity to save

  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com