Show / Hide Table of Contents

Interface IOwnedItemRepository<T>

Defines the contract for a repository that manages items that have an owner.

Inherited Members
IRepository<T>.SaveAsync(T)
IRepository<T>.SaveAsync(IList<T>)
IRepository<T>.DeleteAsync(string)
IRepository<T>.GetByIdAsync(string)
IRepository<T>.GetAllAsync()
IRepository<T>.GetPagedAsync(int, string)
Namespace: Benday.CosmosDb.Repositories
Assembly: Benday.CosmosDb.dll
Syntax
public interface IOwnedItemRepository<T> : IRepository<T> where T : class, IOwnedItem, new()
Type Parameters
Name Description
T

Domain model type managed by the repository

Methods

| Edit this page View Source

DeleteAllByOwnerIdAsync(string, int, int, CancellationToken)

Deletes all items for the specified owner with configurable throttling and retry logic.

Declaration
Task DeleteAllByOwnerIdAsync(string ownerId, int maxConcurrency, int maxRetries, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string ownerId

Owner id for the items to delete

int maxConcurrency

Maximum number of concurrent delete operations

int maxRetries

Maximum number of retry attempts for throttled requests

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task
| Edit this page View Source

DeleteAllByOwnerIdAsync(string, CancellationToken)

Deletes all items for the specified owner with throttling and retry logic.

Declaration
Task DeleteAllByOwnerIdAsync(string ownerId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string ownerId

Owner id for the items to delete

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task
| Edit this page View Source

DeleteAsync(T)

Delete an item from the repository.

Declaration
Task DeleteAsync(T itemToDelete)
Parameters
Type Name Description
T itemToDelete

Item to delete

Returns
Type Description
Task
| Edit this page View Source

GetAllAsync(string)

Get all items in the repository that have the specified owner id.

Declaration
Task<IEnumerable<T>> GetAllAsync(string ownerId)
Parameters
Type Name Description
string ownerId

Owner id

Returns
Type Description
Task<IEnumerable<T>>

Matching items

| Edit this page View Source

GetByIdAsync(string, string)

Get a specific item by its id and owner id.

Declaration
Task<T?> GetByIdAsync(string ownerId, string id)
Parameters
Type Name Description
string ownerId

Owner id

string id

Id for the entity

Returns
Type Description
Task<T>

The matching item or null

| Edit this page View Source

SaveAllAsync(IEnumerable<T>, int, int, CancellationToken)

Saves multiple items with configurable throttling and retry logic.

Declaration
Task SaveAllAsync(IEnumerable<T> items, int maxConcurrency, int maxRetries, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IEnumerable<T> items

Items to save

int maxConcurrency

Maximum number of concurrent save operations

int maxRetries

Maximum number of retry attempts for throttled requests

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task
| Edit this page View Source

SaveAllAsync(IEnumerable<T>, CancellationToken)

Saves multiple items with throttling and retry logic.

Declaration
Task SaveAllAsync(IEnumerable<T> items, CancellationToken cancellationToken = default)
Parameters
Type Name Description
IEnumerable<T> items

Items to save

CancellationToken cancellationToken

Cancellation token

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