Browse Source

Renamed Repository to BasicRepository and QueryableRepository to Repository.

pull/194/head
Halil İbrahim Kalkan 9 years ago
parent
commit
066b07b800
  1. 4
      src/AbpDesk/AbpDesk.Application/AbpDesk/Tickets/TicketAppService.cs
  2. 4
      src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs
  3. 4
      src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs
  4. 2
      src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs
  5. 4
      src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs
  6. BIN
      src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll
  7. 8
      src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs
  8. 8
      src/Volo.Abp.Ddd/Volo/Abp/Application/Services/AsyncCrudAppService.cs
  9. 8
      src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppService.cs
  10. 4
      src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppServiceBase.cs
  11. 4
      src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/CommonDbContextRegistrationOptions.cs
  12. 90
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs
  13. 114
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IBasicRepository.cs
  14. 38
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs
  15. 114
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs
  16. 118
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs
  17. 72
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs
  18. 8
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs
  19. 6
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EfCoreRepositoryExtensions.cs
  20. 2
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs
  21. 4
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs
  22. 2
      src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs
  23. 2
      src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs
  24. 2
      src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs
  25. 2
      src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/IClientRepository.cs
  26. 2
      src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs
  27. 2
      src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs
  28. 4
      src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/IMemoryDbRepository.cs
  29. 2
      src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs
  30. 6
      src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDbCoreRepositoryExtensions.cs
  31. 4
      src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs
  32. 2
      src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
  33. 8
      src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs
  34. 2
      src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantRepository.cs
  35. 4
      test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs
  36. 38
      test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs
  37. 4
      test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs
  38. 4
      test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DataFiltering/MultiTenant_Filter_Tests.cs
  39. 4
      test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DataFiltering/SoftDelete_Filter_Tests.cs
  40. 4
      test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs
  41. 12
      test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Tests.cs
  42. 8
      test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Transaction_Tests.cs
  43. 4
      test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs
  44. 4
      test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs
  45. 4
      test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MemoryDb_SoftDelete_DataFilter_Tests.cs
  46. 4
      test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MultiTenant_Filter_Tests.cs
  47. 4
      test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/Repositories/MemoryDb_Basic_Repository_Tests.cs
  48. 2
      test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs
  49. 4
      test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs

4
src/AbpDesk/AbpDesk.Application/AbpDesk/Tickets/TicketAppService.cs

@ -12,11 +12,11 @@ namespace AbpDesk.Tickets
{
public class TicketAppService : ApplicationService, ITicketAppService
{
private readonly IQueryableRepository<Ticket, int> _ticketRepository;
private readonly IRepository<Ticket, int> _ticketRepository;
private readonly IAsyncQueryableExecuter _asyncQueryableExecuter;
public TicketAppService(
IQueryableRepository<Ticket, int> ticketRepository,
IRepository<Ticket, int> ticketRepository,
IAsyncQueryableExecuter asyncQueryableExecuter)
{
_ticketRepository = ticketRepository;

4
src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs

@ -9,11 +9,11 @@ namespace AbpDesk.ConsoleDemo
{
public class BlogPostLister : ITransientDependency
{
private readonly IQueryableRepository<BlogPost, Guid> _blogPostRepository;
private readonly IRepository<BlogPost, Guid> _blogPostRepository;
private readonly IGuidGenerator _guidGenerator;
public BlogPostLister(
IQueryableRepository<BlogPost, Guid> blogPostRepository,
IRepository<BlogPost, Guid> blogPostRepository,
IGuidGenerator guidGenerator)
{
_blogPostRepository = blogPostRepository;

4
src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs

@ -11,11 +11,11 @@ namespace AbpDesk.ConsoleDemo
public class UserLister : ITransientDependency
{
private readonly IdentityUserManager _userManager;
private readonly IQueryableRepository<IdentityUser, Guid> _userRepository;
private readonly IRepository<IdentityUser, Guid> _userRepository;
public UserLister(
IdentityUserManager userManager,
IQueryableRepository<IdentityUser, Guid> userRepository)
IRepository<IdentityUser, Guid> userRepository)
{
_userManager = userManager;
_userRepository = userRepository;

2
src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs

@ -47,7 +47,7 @@ namespace AbpDesk.Blogging
using (var uow = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>().Begin())
{
var blogPostRepository = scope.ServiceProvider.GetRequiredService<IQueryableRepository<BlogPost, Guid>>();
var blogPostRepository = scope.ServiceProvider.GetRequiredService<IRepository<BlogPost, Guid>>();
if (blogPostRepository.Any())
{
logger.LogInformation($"No need to seed database since there are already {blogPostRepository.Count()} blog posts!");

4
src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs

@ -10,9 +10,9 @@ namespace Areas.Blog.Controllers
[Area("Blog")]
public class PostsController : AbpController
{
private readonly IQueryableRepository<BlogPost, Guid> _blogPostRepository;
private readonly IRepository<BlogPost, Guid> _blogPostRepository;
public PostsController(IQueryableRepository<BlogPost, Guid> blogPostRepository)
public PostsController(IRepository<BlogPost, Guid> blogPostRepository)
{
_blogPostRepository = blogPostRepository;
}

BIN
src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll

Binary file not shown.

8
src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs

@ -12,7 +12,7 @@ namespace Microsoft.Extensions.DependencyInjection
public static IServiceCollection AddDefaultRepository(this IServiceCollection services, Type entityType, Type repositoryImplementationType)
{
//IRepository<TEntity>
var repositoryInterfaceWithoutPk = typeof(IRepository<>).MakeGenericType(entityType);
var repositoryInterfaceWithoutPk = typeof(IBasicRepository<>).MakeGenericType(entityType);
if (!repositoryInterfaceWithoutPk.IsAssignableFrom(repositoryImplementationType))
{
throw new AbpException($"Given repositoryImplementationType ({repositoryImplementationType}) must implement {repositoryInterfaceWithoutPk}");
@ -21,7 +21,7 @@ namespace Microsoft.Extensions.DependencyInjection
services.TryAddTransient(repositoryInterfaceWithoutPk, repositoryImplementationType);
//IQueryableRepository<TEntity>
var queryableRepositoryInterfaceWithPk = typeof(IQueryableRepository<>).MakeGenericType(entityType);
var queryableRepositoryInterfaceWithPk = typeof(IRepository<>).MakeGenericType(entityType);
if (repositoryInterfaceWithoutPk.IsAssignableFrom(repositoryImplementationType))
{
services.TryAddTransient(queryableRepositoryInterfaceWithPk, repositoryImplementationType);
@ -32,14 +32,14 @@ namespace Microsoft.Extensions.DependencyInjection
if (primaryKeyType != null)
{
//IRepository<TEntity, TKey>
var repositoryInterface = typeof(IRepository<,>).MakeGenericType(entityType, primaryKeyType);
var repositoryInterface = typeof(IBasicRepository<,>).MakeGenericType(entityType, primaryKeyType);
if (repositoryInterface.GetTypeInfo().IsAssignableFrom(repositoryImplementationType))
{
services.TryAddTransient(repositoryInterface, repositoryImplementationType);
}
//IQueryableRepository<TEntity, TKey>
var queryableRepositoryInterface = typeof(IQueryableRepository<,>).MakeGenericType(entityType, primaryKeyType);
var queryableRepositoryInterface = typeof(IRepository<,>).MakeGenericType(entityType, primaryKeyType);
if (queryableRepositoryInterface.GetTypeInfo().IsAssignableFrom(repositoryImplementationType))
{
services.TryAddTransient(queryableRepositoryInterface, repositoryImplementationType);

8
src/Volo.Abp.Ddd/Volo/Abp/Application/Services/AsyncCrudAppService.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected AsyncCrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected AsyncCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
@ -24,7 +24,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected AsyncCrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected AsyncCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
@ -38,7 +38,7 @@ namespace Volo.Abp.Application.Services
where TEntityDto : IEntityDto<TKey>
where TCreateInput : IEntityDto<TKey>
{
protected AsyncCrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected AsyncCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
@ -53,7 +53,7 @@ namespace Volo.Abp.Application.Services
{
public IAsyncQueryableExecuter AsyncQueryableExecuter { get; set; }
protected AsyncCrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected AsyncCrudAppService(IRepository<TEntity, TKey> repository)
:base(repository)
{
AsyncQueryableExecuter = DefaultAsyncQueryableExecuter.Instance;

8
src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppService.cs

@ -10,7 +10,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected CrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected CrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
@ -22,7 +22,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected CrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected CrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
@ -35,7 +35,7 @@ namespace Volo.Abp.Application.Services
where TEntityDto : IEntityDto<TKey>
where TCreateInput : IEntityDto<TKey>
{
protected CrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected CrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
@ -48,7 +48,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected CrudAppService(IQueryableRepository<TEntity, TKey> repository)
protected CrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{

4
src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppServiceBase.cs

@ -15,7 +15,7 @@ namespace Volo.Abp.Application.Services
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected IQueryableRepository<TEntity, TKey> Repository { get; }
protected IRepository<TEntity, TKey> Repository { get; }
protected virtual string GetPermissionName { get; set; }
@ -27,7 +27,7 @@ namespace Volo.Abp.Application.Services
protected virtual string DeletePermissionName { get; set; }
protected CrudAppServiceBase(IQueryableRepository<TEntity, TKey> repository)
protected CrudAppServiceBase(IRepository<TEntity, TKey> repository)
{
Repository = repository;
}

4
src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/CommonDbContextRegistrationOptions.cs

@ -107,9 +107,9 @@ namespace Volo.Abp.DependencyInjection
throw new AbpException($"Given entityType is not an entity: {entityType.AssemblyQualifiedName}. It must implement {typeof(IEntity<>).AssemblyQualifiedName}.");
}
if (!ReflectionHelper.IsAssignableToGenericType(repositoryType, typeof(IRepository<>)))
if (!ReflectionHelper.IsAssignableToGenericType(repositoryType, typeof(IBasicRepository<>)))
{
throw new AbpException($"Given repositoryType is not a repository: {entityType.AssemblyQualifiedName}. It must implement {typeof(IRepository<>).AssemblyQualifiedName}.");
throw new AbpException($"Given repositoryType is not a repository: {entityType.AssemblyQualifiedName}. It must implement {typeof(IBasicRepository<>).AssemblyQualifiedName}.");
}
CustomRepositories[entityType] = repositoryType;

90
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs

@ -0,0 +1,90 @@
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Threading;
namespace Volo.Abp.Domain.Repositories
{
public abstract class BasicRepositoryBase<TEntity> : IBasicRepository<TEntity>
where TEntity : class, IEntity
{
public ICancellationTokenProvider CancellationTokenProvider { get; set; }
protected BasicRepositoryBase()
{
CancellationTokenProvider = NullCancellationTokenProvider.Instance;
}
public abstract TEntity Insert(TEntity entity, bool autoSave = false);
public virtual Task<TEntity> InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
{
return Task.FromResult(Insert(entity, autoSave));
}
public abstract TEntity Update(TEntity entity);
public virtual Task<TEntity> UpdateAsync(TEntity entity, CancellationToken cancellationToken = default)
{
return Task.FromResult(Update(entity));
}
public abstract void Delete(TEntity entity);
public virtual Task DeleteAsync(TEntity entity, CancellationToken cancellationToken = default)
{
Delete(entity);
return Task.CompletedTask;
}
protected virtual CancellationToken GetCancellationToken(CancellationToken prefferedValue = default)
{
return CancellationTokenProvider.FallbackToProvider(prefferedValue);
}
}
public abstract class BasicRepositoryBase<TEntity, TKey> : BasicRepositoryBase<TEntity>, IBasicRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{
public virtual TEntity Get(TKey id)
{
var entity = Find(id);
if (entity == null)
{
throw new EntityNotFoundException(typeof(TEntity), id);
}
return entity;
}
public virtual Task<TEntity> GetAsync(TKey id, CancellationToken cancellationToken = default)
{
return Task.FromResult(Get(id));
}
public abstract TEntity Find(TKey id);
public virtual Task<TEntity> FindAsync(TKey id, CancellationToken cancellationToken = default)
{
return Task.FromResult(Find(id));
}
public virtual void Delete(TKey id)
{
var entity = Find(id);
if (entity == null)
{
return;
}
Delete(entity);
}
public virtual Task DeleteAsync(TKey id, CancellationToken cancellationToken = default)
{
Delete(id);
return Task.CompletedTask;
}
}
}

114
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IBasicRepository.cs

@ -0,0 +1,114 @@
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories
{
public interface IBasicRepository<TEntity> : IRepository
where TEntity : class, IEntity
{
/// <summary>
/// Inserts a new entity.
/// </summary>
/// <param name="entity">Inserted entity</param>
/// <param name="autoSave">
/// Set true to automatically save changes to database.
/// This can be used to set database generated Id of an entity for some ORMs (like Entity Framework).
/// </param>
[NotNull]
TEntity Insert([NotNull] TEntity entity, bool autoSave = false);
/// <summary>
/// Inserts a new entity.
/// </summary>
/// <param name="autoSave">
/// Set true to automatically save changes to database.
/// This can be used to set database generated Id of an entity for some ORMs (like Entity Framework).
/// </param>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="entity">Inserted entity</param>
[NotNull]
Task<TEntity> InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default);
/// <summary>
/// Updates an existing entity.
/// </summary>
/// <param name="entity">Entity</param>
[NotNull]
TEntity Update([NotNull] TEntity entity);
/// <summary>
/// Updates an existing entity.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="entity">Entity</param>
[NotNull]
Task<TEntity> UpdateAsync([NotNull] TEntity entity, CancellationToken cancellationToken = default);
/// <summary>
/// Deletes an entity.
/// </summary>
/// <param name="entity">Entity to be deleted</param>
void Delete([NotNull] TEntity entity); //TODO: Return true if deleted
/// <summary>
/// Deletes an entity.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="entity">Entity to be deleted</param>
Task DeleteAsync([NotNull] TEntity entity, CancellationToken cancellationToken = default); //TODO: Return true if deleted
}
public interface IBasicRepository<TEntity, TKey> : IBasicRepository<TEntity>
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>
/// <param name="id">Primary key of the entity</param>
void Delete(TKey id); //TODO: Return true if deleted
/// <summary>
/// Deletes an entity by primary key.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="id">Primary key of the entity</param>
Task DeleteAsync(TKey id, CancellationToken cancellationToken = default); //TODO: Return true if deleted
}
}

38
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs

@ -1,38 +0,0 @@
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories
{
public interface IQueryableRepository<TEntity> : IRepository<TEntity>, IQueryable<TEntity>
where TEntity : class, IEntity
{
/// <summary>
/// Deletes many entities by function.
/// Notice that: All entities fits to given predicate are retrieved and deleted.
/// This may cause major performance problems if there are too many entities with
/// given predicate.
/// </summary>
/// <param name="predicate">A condition to filter entities</param>
void Delete([NotNull] Expression<Func<TEntity, bool>> predicate);
/// <summary>
/// Deletes many entities by function.
/// Notice that: All entities fits to given predicate are retrieved and deleted.
/// This may cause major performance problems if there are too many entities with
/// given predicate.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="predicate">A condition to filter entities</param>
Task DeleteAsync([NotNull] Expression<Func<TEntity, bool>> predicate, CancellationToken cancellationToken = default);
}
public interface IQueryableRepository<TEntity, TKey> : IQueryableRepository<TEntity>, IRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{
}
}

114
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs

@ -1,4 +1,7 @@
using System.Threading;
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.DependencyInjection;
@ -14,110 +17,31 @@ namespace Volo.Abp.Domain.Repositories
}
public interface IRepository<TEntity> : IRepository
public interface IRepository<TEntity> : IBasicRepository<TEntity>, IQueryable<TEntity>
where TEntity : class, IEntity
{
/// <summary>
/// Inserts a new entity.
/// Deletes many entities by function.
/// Notice that: All entities fits to given predicate are retrieved and deleted.
/// This may cause major performance problems if there are too many entities with
/// given predicate.
/// </summary>
/// <param name="entity">Inserted entity</param>
/// <param name="autoSave">
/// Set true to automatically save changes to database.
/// This can be used to set database generated Id of an entity for some ORMs (like Entity Framework).
/// </param>
[NotNull]
TEntity Insert([NotNull] TEntity entity, bool autoSave = false);
/// <param name="predicate">A condition to filter entities</param>
void Delete([NotNull] Expression<Func<TEntity, bool>> predicate);
/// <summary>
/// Inserts a new entity.
/// Deletes many entities by function.
/// Notice that: All entities fits to given predicate are retrieved and deleted.
/// This may cause major performance problems if there are too many entities with
/// given predicate.
/// </summary>
/// <param name="autoSave">
/// Set true to automatically save changes to database.
/// This can be used to set database generated Id of an entity for some ORMs (like Entity Framework).
/// </param>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="entity">Inserted entity</param>
[NotNull]
Task<TEntity> InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default);
/// <summary>
/// Updates an existing entity.
/// </summary>
/// <param name="entity">Entity</param>
[NotNull]
TEntity Update([NotNull] TEntity entity);
/// <summary>
/// Updates an existing entity.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="entity">Entity</param>
[NotNull]
Task<TEntity> UpdateAsync([NotNull] TEntity entity, CancellationToken cancellationToken = default);
/// <summary>
/// Deletes an entity.
/// </summary>
/// <param name="entity">Entity to be deleted</param>
void Delete([NotNull] TEntity entity); //TODO: Return true if deleted
/// <summary>
/// Deletes an entity.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="entity">Entity to be deleted</param>
Task DeleteAsync([NotNull] TEntity entity, CancellationToken cancellationToken = default); //TODO: Return true if deleted
/// <param name="predicate">A condition to filter entities</param>
Task DeleteAsync([NotNull] Expression<Func<TEntity, bool>> predicate, CancellationToken cancellationToken = default);
}
public interface IRepository<TEntity, TKey> : IRepository<TEntity>
public interface IRepository<TEntity, TKey> : IRepository<TEntity>, IBasicRepository<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>
/// <param name="id">Primary key of the entity</param>
void Delete(TKey id); //TODO: Return true if deleted
/// <summary>
/// Deletes an entity by primary key.
/// </summary>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <param name="id">Primary key of the entity</param>
Task DeleteAsync(TKey id, CancellationToken cancellationToken = default); //TODO: Return true if deleted
}
}
}

118
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs

@ -1,118 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Domain.Repositories
{
public abstract class QueryableRepositoryBase<TEntity> : RepositoryBase<TEntity>, IQueryableRepository<TEntity>
where TEntity : class, IEntity
{
public IDataFilter DataFilter { get; set; }
public ICurrentTenant CurrentTenant { get; set; }
public virtual Type ElementType => GetQueryable().ElementType;
public virtual Expression Expression => GetQueryable().Expression;
public virtual IQueryProvider Provider => GetQueryable().Provider;
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public IEnumerator<TEntity> GetEnumerator()
{
return GetQueryable().GetEnumerator();
}
protected abstract IQueryable<TEntity> GetQueryable();
public virtual void Delete(Expression<Func<TEntity, bool>> predicate)
{
foreach (var entity in GetQueryable().Where(predicate).ToList())
{
Delete(entity);
}
}
public virtual Task DeleteAsync(Expression<Func<TEntity, bool>> predicate, CancellationToken cancellationToken = default)
{
Delete(predicate);
return Task.CompletedTask;
}
//TODO: Is that needed..?
protected virtual IQueryable<TEntity> ApplyDataFilters(IQueryable<TEntity> query)
{
if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)))
{
query = query.WhereIf(DataFilter.IsEnabled<ISoftDelete>(), e => ((ISoftDelete)e).IsDeleted == false);
}
if (typeof(IMultiTenant).IsAssignableFrom(typeof(TEntity)))
{
var tenantId = CurrentTenant.Id;
query = query.WhereIf(DataFilter.IsEnabled<IMultiTenant>(), e => ((IMultiTenant)e).TenantId == tenantId);
}
return query;
}
}
public abstract class QueryableRepositoryBase<TEntity, TKey> : QueryableRepositoryBase<TEntity>, IQueryableRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{
public virtual TEntity Find(TKey id)
{
return GetQueryable().FirstOrDefault(EntityHelper.CreateEqualityExpressionForId<TEntity, TKey>(id));
}
public virtual TEntity Get(TKey id)
{
var entity = Find(id);
if (entity == null)
{
throw new EntityNotFoundException(typeof(TEntity), id);
}
return entity;
}
public virtual Task<TEntity> GetAsync(TKey id, CancellationToken cancellationToken = default)
{
return Task.FromResult(Get(id));
}
public virtual Task<TEntity> FindAsync(TKey id, CancellationToken cancellationToken = default)
{
return Task.FromResult(Find(id));
}
public virtual void Delete(TKey id)
{
var entity = Find(id);
if (entity == null)
{
return;
}
Delete(entity);
}
public virtual Task DeleteAsync(TKey id, CancellationToken cancellationToken = default)
{
Delete(id);
return Task.CompletedTask;
}
}
}

72
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs

@ -1,51 +1,81 @@
using System.Threading;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Threading;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Domain.Repositories
{
public abstract class RepositoryBase<TEntity> : IRepository<TEntity>
public abstract class RepositoryBase<TEntity> : BasicRepositoryBase<TEntity>, IRepository<TEntity>
where TEntity : class, IEntity
{
public ICancellationTokenProvider CancellationTokenProvider { get; set; }
public IDataFilter DataFilter { get; set; }
protected RepositoryBase()
public ICurrentTenant CurrentTenant { get; set; }
public virtual Type ElementType => GetQueryable().ElementType;
public virtual Expression Expression => GetQueryable().Expression;
public virtual IQueryProvider Provider => GetQueryable().Provider;
IEnumerator IEnumerable.GetEnumerator()
{
CancellationTokenProvider = NullCancellationTokenProvider.Instance;
return GetEnumerator();
}
public abstract TEntity Insert(TEntity entity, bool autoSave = false);
public virtual Task<TEntity> InsertAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
public IEnumerator<TEntity> GetEnumerator()
{
return Task.FromResult(Insert(entity, autoSave));
return GetQueryable().GetEnumerator();
}
public abstract TEntity Update(TEntity entity);
protected abstract IQueryable<TEntity> GetQueryable();
public virtual Task<TEntity> UpdateAsync(TEntity entity, CancellationToken cancellationToken = default)
public virtual void Delete(Expression<Func<TEntity, bool>> predicate)
{
return Task.FromResult(Update(entity));
foreach (var entity in GetQueryable().Where(predicate).ToList())
{
Delete(entity);
}
}
public abstract void Delete(TEntity entity);
public virtual Task DeleteAsync(TEntity entity, CancellationToken cancellationToken = default)
public virtual Task DeleteAsync(Expression<Func<TEntity, bool>> predicate, CancellationToken cancellationToken = default)
{
Delete(entity);
Delete(predicate);
return Task.CompletedTask;
}
protected virtual CancellationToken GetCancellationToken(CancellationToken prefferedValue = default)
//TODO: Is that needed..?
protected virtual IQueryable<TEntity> ApplyDataFilters(IQueryable<TEntity> query)
{
return CancellationTokenProvider.FallbackToProvider(prefferedValue);
if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)))
{
query = query.WhereIf(DataFilter.IsEnabled<ISoftDelete>(), e => ((ISoftDelete)e).IsDeleted == false);
}
if (typeof(IMultiTenant).IsAssignableFrom(typeof(TEntity)))
{
var tenantId = CurrentTenant.Id;
query = query.WhereIf(DataFilter.IsEnabled<IMultiTenant>(), e => ((IMultiTenant)e).TenantId == tenantId);
}
return query;
}
}
public abstract class RepositoryBase<TEntity, TKey> : RepositoryBase<TEntity>, IRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{
public virtual TEntity Find(TKey id)
{
return GetQueryable().FirstOrDefault(EntityHelper.CreateEqualityExpressionForId<TEntity, TKey>(id));
}
public virtual TEntity Get(TKey id)
{
var entity = Find(id);
@ -63,8 +93,6 @@ namespace Volo.Abp.Domain.Repositories
return Task.FromResult(Get(id));
}
public abstract TEntity Find(TKey id);
public virtual Task<TEntity> FindAsync(TKey id, CancellationToken cancellationToken = default)
{
return Task.FromResult(Find(id));
@ -87,4 +115,4 @@ namespace Volo.Abp.Domain.Repositories
return Task.CompletedTask;
}
}
}
}

8
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.Domain.Repositories
public static class RepositoryExtensions
{
public static async Task EnsureCollectionLoadedAsync<TEntity, TKey, TProperty>(
this IRepository<TEntity, TKey> repository,
this IBasicRepository<TEntity, TKey> repository,
TEntity entity,
Expression<Func<TEntity, IEnumerable<TProperty>>> propertyExpression,
CancellationToken cancellationToken = default
@ -28,7 +28,7 @@ namespace Volo.Abp.Domain.Repositories
}
public static void EnsureCollectionLoaded<TEntity, TKey, TProperty>(
this IRepository<TEntity, TKey> repository,
this IBasicRepository<TEntity, TKey> repository,
TEntity entity,
Expression<Func<TEntity, IEnumerable<TProperty>>> propertyExpression
)
@ -39,7 +39,7 @@ namespace Volo.Abp.Domain.Repositories
}
public static async Task EnsurePropertyLoadedAsync<TEntity, TKey, TProperty>(
this IRepository<TEntity, TKey> repository,
this IBasicRepository<TEntity, TKey> repository,
TEntity entity,
Expression<Func<TEntity, TProperty>> propertyExpression,
CancellationToken cancellationToken = default
@ -55,7 +55,7 @@ namespace Volo.Abp.Domain.Repositories
}
public static void EnsurePropertyLoaded<TEntity, TKey, TProperty>(
this IRepository<TEntity, TKey> repository,
this IBasicRepository<TEntity, TKey> repository,
TEntity entity,
Expression<Func<TEntity, TProperty>> propertyExpression
)

6
src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EfCoreRepositoryExtensions.cs

@ -7,19 +7,19 @@ namespace Volo.Abp.Domain.Repositories
{
public static class EfCoreRepositoryExtensions
{
public static DbContext GetDbContext<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static DbContext GetDbContext<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToEfCoreRepository().DbContext;
}
public static DbSet<TEntity> GetDbSet<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static DbSet<TEntity> GetDbSet<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToEfCoreRepository().DbSet;
}
public static IEfCoreRepository<TEntity, TKey> ToEfCoreRepository<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static IEfCoreRepository<TEntity, TKey> ToEfCoreRepository<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
var efCoreRepository = repository as IEfCoreRepository<TEntity, TKey>;

2
src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs

@ -10,7 +10,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore
{
public class EfCoreRepository<TDbContext, TEntity> : QueryableRepositoryBase<TEntity>, IEfCoreRepository<TEntity>
public class EfCoreRepository<TDbContext, TEntity> : RepositoryBase<TEntity>, IEfCoreRepository<TEntity>
where TDbContext : IEfCoreDbContext
where TEntity : class, IEntity
{

4
src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs

@ -3,7 +3,7 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore
{
public interface IEfCoreRepository<TEntity> : IQueryableRepository<TEntity>
public interface IEfCoreRepository<TEntity> : IRepository<TEntity>
where TEntity : class, IEntity
{
DbContext DbContext { get; }
@ -11,7 +11,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore
DbSet<TEntity> DbSet { get; }
}
public interface IEfCoreRepository<TEntity, TKey> : IEfCoreRepository<TEntity>, IQueryableRepository<TEntity, TKey>
public interface IEfCoreRepository<TEntity, TKey> : IEfCoreRepository<TEntity>, IRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{

2
src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs

@ -6,7 +6,7 @@ using Volo.Abp.Domain.Repositories;
namespace Volo.Abp.Identity
{
public interface IIdentityRoleRepository : IRepository<IdentityRole, Guid>
public interface IIdentityRoleRepository : IBasicRepository<IdentityRole, Guid>
{
Task<IdentityRole> FindByNormalizedNameAsync(string normalizedRoleName, CancellationToken cancellationToken);

2
src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs

@ -8,7 +8,7 @@ using Volo.Abp.Domain.Repositories;
namespace Volo.Abp.Identity
{
public interface IIdentityUserRepository : IRepository<IdentityUser, Guid>
public interface IIdentityUserRepository : IBasicRepository<IdentityUser, Guid>
{
Task<IdentityUser> FindByNormalizedUserNameAsync([NotNull] string normalizedUserName, CancellationToken cancellationToken = default);

2
src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs

@ -5,7 +5,7 @@ using Volo.Abp.Domain.Repositories;
namespace Volo.Abp.IdentityServer.ApiResources
{
public interface IApiResourceRepository : IRepository<ApiResource, Guid>
public interface IApiResourceRepository : IBasicRepository<ApiResource, Guid>
{
Task<ApiResource> FindByNameAsync(string name, CancellationToken cancellationToken = default);
}

2
src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/IClientRepository.cs

@ -5,7 +5,7 @@ using Volo.Abp.Domain.Repositories;
namespace Volo.Abp.IdentityServer.Clients
{
public interface IClientRepository : IRepository<Client, Guid>
public interface IClientRepository : IBasicRepository<Client, Guid>
{
Task<Client> FindByCliendIdIncludingAllAsync([NotNull] string clientId);
}

2
src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs

@ -5,7 +5,7 @@ using Volo.Abp.Domain.Repositories;
namespace Volo.Abp.IdentityServer.Grants
{
public interface IPersistentGrantRepository : IRepository<PersistedGrant, Guid>
public interface IPersistentGrantRepository : IBasicRepository<PersistedGrant, Guid>
{
Task<PersistedGrant> FindByKeyAsync(string key);

2
src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs

@ -6,7 +6,7 @@ using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource;
namespace Volo.Abp.IdentityServer.IdentityResources
{
public interface IIdentityResourceRepository : IRepository<IdentityResource, Guid>
public interface IIdentityResourceRepository : IBasicRepository<IdentityResource, Guid>
{
Task<List<IdentityResource>> FindIdentityResourcesByScopeAsync(string[] scopeNames);

4
src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/IMemoryDbRepository.cs

@ -3,7 +3,7 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories.MemoryDb
{
public interface IMemoryDbRepository<TEntity> : IQueryableRepository<TEntity>
public interface IMemoryDbRepository<TEntity> : IRepository<TEntity>
where TEntity : class, IEntity
{
IMemoryDatabase Database { get; }
@ -11,7 +11,7 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb
List<TEntity> Collection { get; }
}
public interface IMemoryDbRepository<TEntity, TKey> : IMemoryDbRepository<TEntity>, IQueryableRepository<TEntity, TKey>
public interface IMemoryDbRepository<TEntity, TKey> : IMemoryDbRepository<TEntity>, IRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{

2
src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs

@ -8,7 +8,7 @@ using Volo.Abp.MemoryDb;
namespace Volo.Abp.Domain.Repositories.MemoryDb
{
public class MemoryDbRepository<TMemoryDbContext, TEntity> : QueryableRepositoryBase<TEntity>, IMemoryDbRepository<TEntity>
public class MemoryDbRepository<TMemoryDbContext, TEntity> : RepositoryBase<TEntity>, IMemoryDbRepository<TEntity>
where TMemoryDbContext : MemoryDbContext
where TEntity : class, IEntity
{

6
src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDbCoreRepositoryExtensions.cs

@ -7,19 +7,19 @@ namespace Volo.Abp.Domain.Repositories
{
public static class MemoryDbCoreRepositoryExtensions
{
public static IMemoryDatabase GetDatabase<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static IMemoryDatabase GetDatabase<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToMemoryDbRepository().Database;
}
public static List<TEntity> GetCollection<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static List<TEntity> GetCollection<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToMemoryDbRepository().Collection;
}
public static IMemoryDbRepository<TEntity, TKey> ToMemoryDbRepository<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static IMemoryDbRepository<TEntity, TKey> ToMemoryDbRepository<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
var memoryDbRepository = repository as IMemoryDbRepository<TEntity, TKey>;

4
src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs

@ -3,7 +3,7 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories.MongoDB
{
public interface IMongoDbRepository<TEntity> : IQueryableRepository<TEntity>
public interface IMongoDbRepository<TEntity> : IRepository<TEntity>
where TEntity : class, IEntity
{
IMongoDatabase Database { get; }
@ -13,7 +13,7 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
string CollectionName { get; }
}
public interface IMongoDbRepository<TEntity, TKey> : IMongoDbRepository<TEntity>, IQueryableRepository<TEntity, TKey>
public interface IMongoDbRepository<TEntity, TKey> : IMongoDbRepository<TEntity>, IRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{

2
src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs

@ -9,7 +9,7 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.Domain.Repositories.MongoDB
{
public class MongoDbRepository<TMongoDbContext, TEntity> : QueryableRepositoryBase<TEntity>, IMongoDbRepository<TEntity>
public class MongoDbRepository<TMongoDbContext, TEntity> : RepositoryBase<TEntity>, IMongoDbRepository<TEntity>
where TMongoDbContext : AbpMongoDbContext
where TEntity : class, IEntity
{

8
src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDbCoreRepositoryExtensions.cs

@ -7,25 +7,25 @@ namespace Volo.Abp.Domain.Repositories
{
public static class MongoDbCoreRepositoryExtensions
{
public static IMongoDatabase GetDatabase<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static IMongoDatabase GetDatabase<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToMongoDbRepository().Database;
}
public static IMongoCollection<TEntity> GetCollection<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static IMongoCollection<TEntity> GetCollection<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToMongoDbRepository().Collection;
}
public static string GetCollectionName<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static string GetCollectionName<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
return repository.ToMongoDbRepository().CollectionName;
}
public static IMongoDbRepository<TEntity, TKey> ToMongoDbRepository<TEntity, TKey>(this IRepository<TEntity, TKey> repository)
public static IMongoDbRepository<TEntity, TKey> ToMongoDbRepository<TEntity, TKey>(this IBasicRepository<TEntity, TKey> repository)
where TEntity : class, IEntity<TKey>
{
var mongoDbRepository = repository as IMongoDbRepository<TEntity, TKey>;

2
src/Volo.Abp.MultiTenancy.Domain/Volo/Abp/MultiTenancy/ITenantRepository.cs

@ -4,7 +4,7 @@ using Volo.Abp.Domain.Repositories;
namespace Volo.Abp.MultiTenancy
{
public interface ITenantRepository : IRepository<Tenant, Guid>
public interface ITenantRepository : IBasicRepository<Tenant, Guid>
{
Task<Tenant> FindByNameIncludeDetailsAsync(string name);

4
test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs

@ -20,13 +20,13 @@ namespace Volo.Abp.AspNetCore.Mvc
public class PersonAppService_Tests : AspNetCoreMvcTestBase
{
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
private readonly IJsonSerializer _jsonSerializer;
private readonly IObjectMapper _objectMapper;
public PersonAppService_Tests()
{
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = ServiceProvider.GetRequiredService<IRepository<Person, Guid>>();
_jsonSerializer = ServiceProvider.GetRequiredService<IJsonSerializer>();
_objectMapper = ServiceProvider.GetRequiredService<IObjectMapper>();
}

38
test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs

@ -27,11 +27,11 @@ namespace Volo.Abp.Domain.Repositories
//Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldNotContainService(typeof(IRepository<MyTestEntityWithInt32Pk, int>));
services.ShouldNotContainService(typeof(IBasicRepository<MyTestEntityWithInt32Pk, int>));
}
[Fact]
@ -50,11 +50,11 @@ namespace Volo.Abp.Domain.Repositories
//Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestEntityWithInt32Pk>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
}
[Fact]
@ -75,10 +75,10 @@ namespace Volo.Abp.Domain.Repositories
//Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
}
[Fact]
@ -99,10 +99,10 @@ namespace Volo.Abp.Domain.Repositories
//Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestCustomBaseRepository<MyTestEntityWithInt32Pk, int>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithoutPk>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithoutPk>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IBasicRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestCustomBaseRepository<MyTestEntityWithInt32Pk, int>));
}
public class MyTestRepositoryRegistrar : RepositoryRegistrarBase<CommonDbContextRegistrationOptions>
@ -150,7 +150,7 @@ namespace Volo.Abp.Domain.Repositories
public string MyId { get; set; }
}
public class MyTestDefaultRepository<TEntity> : RepositoryBase<TEntity>
public class MyTestDefaultRepository<TEntity> : BasicRepositoryBase<TEntity>
where TEntity : class, IEntity
{
public override TEntity Insert(TEntity entity, bool autoSave = false)
@ -169,7 +169,7 @@ namespace Volo.Abp.Domain.Repositories
}
}
public class MyTestDefaultRepository<TEntity, TKey> : MyTestDefaultRepository<TEntity>, IRepository<TEntity, TKey>
public class MyTestDefaultRepository<TEntity, TKey> : MyTestDefaultRepository<TEntity>, IBasicRepository<TEntity, TKey>
where TEntity : class, IEntity<TKey>
{
public TEntity Get(TKey id)

4
test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondContextTestDataBuilder.cs

@ -7,10 +7,10 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext
{
public class SecondContextTestDataBuilder : ITransientDependency
{
private readonly IRepository<BookInSecondDbContext, Guid> _bookRepository;
private readonly IBasicRepository<BookInSecondDbContext, Guid> _bookRepository;
private readonly IGuidGenerator _guidGenerator;
public SecondContextTestDataBuilder(IRepository<BookInSecondDbContext, Guid> bookRepository, IGuidGenerator guidGenerator)
public SecondContextTestDataBuilder(IBasicRepository<BookInSecondDbContext, Guid> bookRepository, IGuidGenerator guidGenerator)
{
_bookRepository = bookRepository;
_guidGenerator = guidGenerator;

4
test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DataFiltering/MultiTenant_Filter_Tests.cs

@ -17,12 +17,12 @@ namespace Volo.Abp.EntityFrameworkCore.DataFiltering
public class MultiTenant_Filter_Tests : EntityFrameworkCoreTestBase //TODO: This class is same of Volo.Abp.MemoryDb.DataFilters.MemoryDb_MultiTenant_Filter_Tests. Can we share source code?
{
private ICurrentTenant _fakeCurrentTenant;
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
private readonly IDataFilter<IMultiTenant> _multiTenantFilter;
public MultiTenant_Filter_Tests()
{
_personRepository = GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = GetRequiredService<IRepository<Person, Guid>>();
_multiTenantFilter = GetRequiredService<IDataFilter<IMultiTenant>>();
}

4
test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DataFiltering/SoftDelete_Filter_Tests.cs

@ -10,12 +10,12 @@ namespace Volo.Abp.EntityFrameworkCore.DataFiltering
{
public class SoftDelete_Filter_Tests : EntityFrameworkCoreTestBase
{
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
private readonly IDataFilter _dataFilter;
public SoftDelete_Filter_Tests()
{
_personRepository = GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = GetRequiredService<IRepository<Person, Guid>>();
_dataFilter = GetRequiredService<IDataFilter>();
}

4
test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/DbContext_Replace_Tests.cs

@ -10,11 +10,11 @@ namespace Volo.Abp.EntityFrameworkCore
{
public class DbContext_Replace_Tests : EntityFrameworkCoreTestBase
{
private readonly IRepository<ThirdDbContextDummyEntity, Guid> _dummyRepository;
private readonly IBasicRepository<ThirdDbContextDummyEntity, Guid> _dummyRepository;
public DbContext_Replace_Tests()
{
_dummyRepository = ServiceProvider.GetRequiredService<IRepository<ThirdDbContextDummyEntity, Guid>>();
_dummyRepository = ServiceProvider.GetRequiredService<IBasicRepository<ThirdDbContextDummyEntity, Guid>>();
}
[Fact]

12
test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Repositories/Repository_Tests.cs

@ -12,15 +12,15 @@ namespace Volo.Abp.EntityFrameworkCore.Repositories
{
public class Repository_Tests : EntityFrameworkCoreTestBase
{
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IQueryableRepository<BookInSecondDbContext, Guid> _bookRepository;
private readonly IQueryableRepository<PhoneInSecondDbContext> _phoneInSecondDbContextRepository;
private readonly IRepository<Person, Guid> _personRepository;
private readonly IRepository<BookInSecondDbContext, Guid> _bookRepository;
private readonly IRepository<PhoneInSecondDbContext> _phoneInSecondDbContextRepository;
public Repository_Tests()
{
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
_bookRepository = ServiceProvider.GetRequiredService<IQueryableRepository<BookInSecondDbContext, Guid>>();
_phoneInSecondDbContextRepository = ServiceProvider.GetRequiredService<IQueryableRepository<PhoneInSecondDbContext>>();
_personRepository = ServiceProvider.GetRequiredService<IRepository<Person, Guid>>();
_bookRepository = ServiceProvider.GetRequiredService<IRepository<BookInSecondDbContext, Guid>>();
_phoneInSecondDbContextRepository = ServiceProvider.GetRequiredService<IRepository<PhoneInSecondDbContext>>();
}
[Fact]

8
test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Transaction_Tests.cs

@ -12,14 +12,14 @@ namespace Volo.Abp.EntityFrameworkCore
{
public class Transaction_Tests : EntityFrameworkCoreTestBase
{
private readonly IRepository<Person, Guid> _personRepository;
private readonly IRepository<BookInSecondDbContext, Guid> _bookRepository;
private readonly IBasicRepository<Person, Guid> _personRepository;
private readonly IBasicRepository<BookInSecondDbContext, Guid> _bookRepository;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public Transaction_Tests()
{
_personRepository = ServiceProvider.GetRequiredService<IRepository<Person, Guid>>();
_bookRepository = ServiceProvider.GetRequiredService<IRepository<BookInSecondDbContext, Guid>>();
_personRepository = ServiceProvider.GetRequiredService<IBasicRepository<Person, Guid>>();
_bookRepository = ServiceProvider.GetRequiredService<IBasicRepository<BookInSecondDbContext, Guid>>();
_unitOfWorkManager = ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
}

4
test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/PersonAppServiceClientProxy_Tests.cs

@ -15,12 +15,12 @@ namespace Volo.Abp.Http.DynamicProxying
public class PersonAppServiceClientProxy_Tests : AbpHttpTestBase
{
private readonly IPeopleAppService _peopleAppService;
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
public PersonAppServiceClientProxy_Tests()
{
_peopleAppService = ServiceProvider.GetRequiredService<IPeopleAppService>();
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = ServiceProvider.GetRequiredService<IRepository<Person, Guid>>();
}
[Fact]

4
test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs

@ -26,10 +26,10 @@ namespace Volo.Abp.Identity
{
(ServiceProvider.GetRequiredService<IIdentityUserRepository>() is EfCoreIdentityUserRepository).ShouldBeTrue();
(ServiceProvider.GetRequiredService<IRepository<IdentityUser, Guid>>() is EfCoreIdentityUserRepository).ShouldBeTrue();
(ServiceProvider.GetRequiredService<IBasicRepository<IdentityUser, Guid>>() is EfCoreIdentityUserRepository).ShouldBeTrue();
//(ServiceProvider.GetRequiredService<IRepository<IdentityUser>>() is EfCoreIdentityUserRepository).ShouldBeTrue();
(ServiceProvider.GetRequiredService<IQueryableRepository<IdentityUser, Guid>>() is EfCoreIdentityUserRepository).ShouldBeTrue();
(ServiceProvider.GetRequiredService<IRepository<IdentityUser, Guid>>() is EfCoreIdentityUserRepository).ShouldBeTrue();
//(ServiceProvider.GetRequiredService<IQueryableRepository<IdentityUser>>() is EfCoreIdentityUserRepository).ShouldBeTrue();
}
}

4
test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MemoryDb_SoftDelete_DataFilter_Tests.cs

@ -11,12 +11,12 @@ namespace Volo.Abp.MemoryDb.DataFilters
{
public class MemoryDb_SoftDelete_DataFilter_Tests : MemoryDbTestBase
{
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
private readonly IDataFilter _dataFilter;
public MemoryDb_SoftDelete_DataFilter_Tests()
{
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = ServiceProvider.GetRequiredService<IRepository<Person, Guid>>();
_dataFilter = GetRequiredService<IDataFilter>();
}

4
test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MultiTenant_Filter_Tests.cs

@ -16,12 +16,12 @@ namespace Volo.Abp.MemoryDb.DataFilters
public class MemoryDb_MultiTenant_Filter_Tests : MemoryDbTestBase
{
private ICurrentTenant _fakeCurrentTenant;
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
private readonly IDataFilter<IMultiTenant> _multiTenantFilter;
public MemoryDb_MultiTenant_Filter_Tests()
{
_personRepository = GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = GetRequiredService<IRepository<Person, Guid>>();
_multiTenantFilter = GetRequiredService<IDataFilter<IMultiTenant>>();
}

4
test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/Repositories/MemoryDb_Basic_Repository_Tests.cs

@ -10,11 +10,11 @@ namespace Volo.Abp.MemoryDb.Repositories
{
public class MemoryDb_Basic_Repository_Tests : MemoryDbTestBase
{
private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IRepository<Person, Guid> _personRepository;
public MemoryDb_Basic_Repository_Tests()
{
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
_personRepository = ServiceProvider.GetRequiredService<IRepository<Person, Guid>>();
}
[Fact]

2
test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.TestApp.Application
{
public class PeopleAppService : AsyncCrudAppService<Person, PersonDto, Guid>, IPeopleAppService
{
public PeopleAppService(IQueryableRepository<Person, Guid> repository)
public PeopleAppService(IRepository<Person, Guid> repository)
: base(repository)
{

4
test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestDataBuilder.cs

@ -10,9 +10,9 @@ namespace Volo.Abp.TestApp
public static Guid TenantId1 { get; } = new Guid("55687dce-595c-41b4-a024-2a5e991ac8f4");
public static Guid TenantId2 { get; } = new Guid("f522d19f-5a86-4278-98fb-0577319c544a");
private readonly IRepository<Person, Guid> _personRepository;
private readonly IBasicRepository<Person, Guid> _personRepository;
public TestDataBuilder(IRepository<Person, Guid> personRepository)
public TestDataBuilder(IBasicRepository<Person, Guid> personRepository)
{
_personRepository = personRepository;
}

Loading…
Cancel
Save