Skip to content

easyextensionsentityframeworkcoredatabaserepository IRepositoryT

BigMakCode edited this page Aug 5, 2024 · 1 revision

IRepository< TItem> Public interface

Description

Represents a generic repository interface for accessing and manipulating entities of type TItem.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph EasyExtensions.EntityFrameworkCore.Abstractions
  EasyExtensions.EntityFrameworkCore.Abstractions.BaseEntity[[BaseEntity]]
  class EasyExtensions.EntityFrameworkCore.Abstractions.BaseEntity abstractStyle;
  end
  subgraph EasyExtensions.EntityFrameworkCore.Database.Repository
  EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1[[IRepository< TItem >]]
  class EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1 interfaceStyle;
  EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1TItem((TItem));
  EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1 -- where --o EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1TItem
EasyExtensions.EntityFrameworkCore.Abstractions.BaseEntity --> EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1TItem

  EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository[[IRepository]]
  class EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository interfaceStyle;
  end
EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository --> EasyExtensions.EntityFrameworkCore.Database.Repository.IRepository_1
Loading

Members

Methods

Public methods

Returns Name
Task<TItem> CreateAsync(TItem item)
Task<bool> DeleteAsync(TItem item)
Task<int> DeleteRangeAsync(IEnumerable<TItem> items)
Task<Paging<TItem>> FilterAsync(...)
Filters and paginates the entities asynchronously based on the specified query.
Task<IEnumerable<TItem>> FindAsync(Expression<Func<TItem, bool>> predicate)
Task<TItem> GetByIdAsync(int id)
Retrieves an entity by its ID asynchronously.
Task<IList<TItem>> ListAsync(...)
IQueryable<TItem> Query()
Returns an IQueryable<ModularDoc.Elements.Markdown.TextElement> of entities.
Task<TItem> UpdateAsync(TItem item)

Details

Summary

Represents a generic repository interface for accessing and manipulating entities of type TItem.

Generic types

Type Description Constraints
TItem The type of entity. BaseEntity

Inheritance

Methods

GetByIdAsync

public Task<TItem> GetByIdAsync(int id)
Arguments
Type Name Description
int id The ID of the entity.
Summary

Retrieves an entity by its ID asynchronously.

Returns

A task that represents the asynchronous operation. The task result contains the entity with the specified ID.

CreateAsync

public Task<TItem> CreateAsync(TItem item)
Arguments
Type Name Description
TItem item

DeleteAsync

public Task<bool> DeleteAsync(TItem item)
Arguments
Type Name Description
TItem item

DeleteRangeAsync

public Task<int> DeleteRangeAsync(IEnumerable<TItem> items)
Arguments
Type Name Description
IEnumerable<TItem> items

UpdateAsync

public Task<TItem> UpdateAsync(TItem item)
Arguments
Type Name Description
TItem item

FilterAsync [1/2]

public Task<Paging<TItem>> FilterAsync(IGridifyQuery query)
Arguments
Type Name Description
IGridifyQuery query The query parameters for filtering and pagination.
Summary

Filters and paginates the entities asynchronously based on the specified query.

Returns

A task that represents the asynchronous operation. The task result contains the filtered and paginated entities.

FilterAsync [2/2]

public Task<Paging<TItem>> FilterAsync(IGridifyQuery query, IGridifyMapper<TItem> mapper)
Arguments
Type Name Description
IGridifyQuery query
IGridifyMapper<TItem> mapper

FindAsync

public Task<IEnumerable<TItem>> FindAsync(Expression<Func<TItem, bool>> predicate)
Arguments
Type Name Description
Expression<Func<TItem, bool>> predicate

ListAsync [1/2]

public Task<IList<TItem>> ListAsync(Expression<Func<TItem, bool>> predicate)
Arguments
Type Name Description
Expression<Func<TItem, bool>> predicate

ListAsync [2/2]

public Task<IList<TItem>> ListAsync()
Summary

Gets all entities asynchronously.

Returns

A task that represents the asynchronous operation. The task result contains a collection of all entities.

Query

public IQueryable<TItem> Query()
Summary

Returns an IQueryable<ModularDoc.Elements.Markdown.TextElement> of entities.

Returns

An IQueryable<ModularDoc.Elements.Markdown.TextElement> of entities.

Generated with ModularDoc

Clone this wiki locally