|
|
|
@ -76,44 +76,9 @@ namespace Volo.Abp.Domain.Repositories
|
|
|
|
|
Task DeleteAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); //TODO: Return true if deleted
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IBasicRepository<TEntity, TKey> : IBasicRepository<TEntity>
|
|
|
|
|
public interface IBasicRepository<TEntity, TKey> : IBasicRepository<TEntity>, IReadOnlyBasicRepository<TEntity, TKey>
|
|
|
|
|
where TEntity : class, IEntity<TKey>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an entity with given primary key.
|
|
|
|
|
/// Throws <see cref="EntityNotFoundException"/> if can not find an entity with given id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
|
|
/// <returns>Entity</returns>
|
|
|
|
|
[NotNull]
|
|
|
|
|
TEntity Get(TKey id);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an entity with given primary key.
|
|
|
|
|
/// Throws <see cref="EntityNotFoundException"/> if can not find an entity with given id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
|
|
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
|
|
|
|
|
/// <returns>Entity</returns>
|
|
|
|
|
[NotNull]
|
|
|
|
|
Task<TEntity> GetAsync(TKey id, CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an entity with given primary key or null if not found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
|
|
/// <returns>Entity or null</returns>
|
|
|
|
|
[CanBeNull]
|
|
|
|
|
TEntity Find(TKey id);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an entity with given primary key or null if not found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
|
|
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
|
|
|
|
|
/// <returns>Entity or null</returns>
|
|
|
|
|
Task<TEntity> FindAsync(TKey id, CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes an entity by primary key.
|
|
|
|
|
/// </summary>
|
|
|
|
|