Table of Contents

Interface ICloudStorageRepository<TEntity>

Namespace
CloudStorageORM.Interfaces.Repositories
Assembly
CloudStorageORM.dll
public interface ICloudStorageRepository<TEntity> where TEntity : class

Type Parameters

TEntity

Methods

AddAsync(string, TEntity)

Adds a new entity to storage for the provided identifier.

Task AddAsync(string id, TEntity entity)

Parameters

id string

Entity identifier used to build the storage path.

entity TEntity

Entity instance to persist.

Returns

Task

Examples

await repository.AddAsync("42", user);

FindAsync(string)

Finds an entity by identifier.

Task<TEntity> FindAsync(string id)

Parameters

id string

Entity identifier used to locate the storage object.

Returns

Task<TEntity>

The matching entity when found.

Examples

var user = await repository.FindAsync("42");

ListAsync()

Lists all entities available for this repository type.

Task<List<TEntity>> ListAsync()

Returns

Task<List<TEntity>>

A list containing all stored entities.

Examples

var users = await repository.ListAsync();

RemoveAsync(string)

Removes the entity identified by id from storage.

Task RemoveAsync(string id)

Parameters

id string

Entity identifier used to locate the storage object.

Returns

Task

Examples

await repository.RemoveAsync("42");

UpdateAsync(string, TEntity)

Updates an existing entity in storage for the provided identifier.

Task UpdateAsync(string id, TEntity entity)

Parameters

id string

Entity identifier used to locate the storage object.

entity TEntity

Updated entity instance to persist.

Returns

Task

Examples

await repository.UpdateAsync("42", user);