|
|
@ -1,5 +1,6 @@ |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using JetBrains.Annotations; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.DependencyInjection; |
|
|
using Volo.DependencyInjection; |
|
|
|
|
|
|
|
|
@ -17,12 +18,14 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// Used to get all entities.
|
|
|
/// Used to get all entities.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <returns>List of all entities</returns>
|
|
|
/// <returns>List of all entities</returns>
|
|
|
|
|
|
[NotNull] |
|
|
List<TEntity> GetList(); |
|
|
List<TEntity> GetList(); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Used to get all entities.
|
|
|
/// Used to get all entities.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <returns>List of all entities</returns>
|
|
|
/// <returns>List of all entities</returns>
|
|
|
|
|
|
[NotNull] |
|
|
Task<List<TEntity>> GetListAsync(); |
|
|
Task<List<TEntity>> GetListAsync(); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -30,6 +33,7 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <returns>Entity</returns>
|
|
|
/// <returns>Entity</returns>
|
|
|
|
|
|
[NotNull] |
|
|
TEntity Get(TPrimaryKey id); |
|
|
TEntity Get(TPrimaryKey id); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -37,6 +41,7 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <returns>Entity</returns>
|
|
|
/// <returns>Entity</returns>
|
|
|
|
|
|
[NotNull] |
|
|
Task<TEntity> GetAsync(TPrimaryKey id); |
|
|
Task<TEntity> GetAsync(TPrimaryKey id); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -44,6 +49,7 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <returns>Entity or null</returns>
|
|
|
/// <returns>Entity or null</returns>
|
|
|
|
|
|
[CanBeNull] |
|
|
TEntity Find(TPrimaryKey id); |
|
|
TEntity Find(TPrimaryKey id); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -51,19 +57,22 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <param name="id">Primary key of the entity to get</param>
|
|
|
/// <returns>Entity or null</returns>
|
|
|
/// <returns>Entity or null</returns>
|
|
|
|
|
|
[CanBeNull] |
|
|
Task<TEntity> FindAsync(TPrimaryKey id); |
|
|
Task<TEntity> FindAsync(TPrimaryKey id); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Inserts a new entity.
|
|
|
/// Inserts a new entity.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Inserted entity</param>
|
|
|
/// <param name="entity">Inserted entity</param>
|
|
|
TEntity Insert(TEntity entity); |
|
|
[NotNull] |
|
|
|
|
|
TEntity Insert([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Inserts a new entity.
|
|
|
/// Inserts a new entity.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Inserted entity</param>
|
|
|
/// <param name="entity">Inserted entity</param>
|
|
|
Task<TEntity> InsertAsync(TEntity entity); |
|
|
[NotNull] |
|
|
|
|
|
Task<TEntity> InsertAsync([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Inserts a new entity and gets it's Id.
|
|
|
/// Inserts a new entity and gets it's Id.
|
|
|
@ -72,7 +81,7 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
/// <returns>Id of the entity</returns>
|
|
|
/// <returns>Id of the entity</returns>
|
|
|
TPrimaryKey InsertAndGetId(TEntity entity); |
|
|
TPrimaryKey InsertAndGetId([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Inserts a new entity and gets it's Id.
|
|
|
/// Inserts a new entity and gets it's Id.
|
|
|
@ -81,31 +90,33 @@ namespace Volo.Abp.Domain.Repositories |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
/// <returns>Id of the entity</returns>
|
|
|
/// <returns>Id of the entity</returns>
|
|
|
Task<TPrimaryKey> InsertAndGetIdAsync(TEntity entity); |
|
|
Task<TPrimaryKey> InsertAndGetIdAsync([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Updates an existing entity.
|
|
|
/// Updates an existing entity.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
TEntity Update(TEntity entity); |
|
|
[NotNull] |
|
|
|
|
|
TEntity Update([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Updates an existing entity.
|
|
|
/// Updates an existing entity.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
/// <param name="entity">Entity</param>
|
|
|
Task<TEntity> UpdateAsync(TEntity entity); |
|
|
[NotNull] |
|
|
|
|
|
Task<TEntity> UpdateAsync([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Deletes an entity.
|
|
|
/// Deletes an entity.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Entity to be deleted</param>
|
|
|
/// <param name="entity">Entity to be deleted</param>
|
|
|
void Delete(TEntity entity); |
|
|
void Delete([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Deletes an entity.
|
|
|
/// Deletes an entity.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="entity">Entity to be deleted</param>
|
|
|
/// <param name="entity">Entity to be deleted</param>
|
|
|
Task DeleteAsync(TEntity entity); |
|
|
Task DeleteAsync([NotNull] TEntity entity); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Deletes an entity by primary key.
|
|
|
/// Deletes an entity by primary key.
|
|
|
|