Browse
Sample.LibCore.Data.RepositoriesIRepository
.md
interface

IRepository<TEntity>

public
namespace Core.Data.Repositories; public interface IRepository<TEntity> where TEntity : class

Defines the standard data access operations for an aggregate.

TEntityThe entity type managed by the repository.

Methods

#Task<TEntity> AddAsync( TEntity entity, CancellationToken cancellationToken = default )

Asynchronously adds a new entity to the repository.

entityThe entity instance to be inserted.

cancellationTokenA token to observe for cancellation requests.

returnsThe inserted entity with any database-generated values applied.

#void Update(TEntity entity)

Begins tracking the given entity using the Modified state.

entityThe entity instance to update.