Browse Source

Temporary remove default PK entity, repository, agg root etc.

pull/194/head
Halil İbrahim Kalkan 9 years ago
parent
commit
f66ca10231
  1. 4
      src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs
  2. 4
      src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs
  3. 5
      src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs
  4. 7
      src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs
  5. BIN
      src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll
  6. 50
      src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs
  7. 1
      src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppServiceBase.cs
  8. 8
      src/Volo.Abp.Ddd/Volo/Abp/Application/Services/IAsyncCrudAppService.cs
  9. 8
      src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/CommonDbContextRegistrationOptions.cs
  10. 3
      src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/ICommonDbContextRegistrationOptionsBuilder.cs
  11. 6
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/AggregateRoot.cs
  12. 12
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs
  13. 6
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IAggregateRoot.cs
  14. 12
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IEntity.cs
  15. 8
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs
  16. 8
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs
  17. 8
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs
  18. 8
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs
  19. 18
      src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs
  20. 18
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs
  21. 8
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs
  22. 8
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/EfCoreRepositoryRegistrar.cs
  23. 8
      src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/IMemoryDbRepository.cs
  24. 18
      src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs
  25. 5
      src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/DependencyInjection/MemoryDbRepositoryRegistrar.cs
  26. 8
      src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs
  27. 18
      src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
  28. 5
      src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/MongoDbRepositoryRegistrar.cs
  29. 4
      test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs
  30. 60
      test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs
  31. 4
      test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs
  32. 7
      test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MemoryDb_SoftDelete_DataFilter_Tests.cs
  33. 4
      test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/Repositories/MemoryDb_Basic_Repository_Tests.cs
  34. 2
      test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs
  35. 2
      test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs

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

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

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

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

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

@ -1,4 +1,5 @@
using System.Linq; using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Volo.Abp; using Volo.Abp;
@ -46,7 +47,7 @@ namespace AbpDesk.Blogging
using (var uow = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>().Begin()) using (var uow = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>().Begin())
{ {
var blogPostRepository = scope.ServiceProvider.GetRequiredService<IQueryableRepository<BlogPost>>(); var blogPostRepository = scope.ServiceProvider.GetRequiredService<IQueryableRepository<BlogPost, Guid>>();
if (blogPostRepository.Any()) if (blogPostRepository.Any())
{ {
logger.LogInformation($"No need to seed database since there are already {blogPostRepository.Count()} blog posts!"); logger.LogInformation($"No need to seed database since there are already {blogPostRepository.Count()} blog posts!");

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

@ -1,4 +1,5 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using AbpDesk.Blogging; using AbpDesk.Blogging;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
@ -9,9 +10,9 @@ namespace Areas.Blog.Controllers
[Area("Blog")] [Area("Blog")]
public class PostsController : AbpController public class PostsController : AbpController
{ {
private readonly IQueryableRepository<BlogPost> _blogPostRepository; private readonly IQueryableRepository<BlogPost, Guid> _blogPostRepository;
public PostsController(IQueryableRepository<BlogPost> blogPostRepository) public PostsController(IQueryableRepository<BlogPost, Guid> blogPostRepository)
{ {
_blogPostRepository = blogPostRepository; _blogPostRepository = blogPostRepository;
} }

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

Binary file not shown.

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

@ -14,10 +14,10 @@ namespace Microsoft.Extensions.DependencyInjection
{ {
AddDefaultRepositoryForGenericPrimaryKey(services, entityType, repositoryImplementationType); AddDefaultRepositoryForGenericPrimaryKey(services, entityType, repositoryImplementationType);
if (BothSupportsDefaultPrimaryKey(entityType, repositoryImplementationType)) //if (BothSupportsDefaultPrimaryKey(entityType, repositoryImplementationType))
{ //{
AddDefaultRepositoryForDefaultPrimaryKey(services, entityType, repositoryImplementationType); // AddDefaultRepositoryForDefaultPrimaryKey(services, entityType, repositoryImplementationType);
} //}
} }
private static void AddDefaultRepositoryForGenericPrimaryKey(IServiceCollection services, Type entityType, Type repositoryImplementationType) private static void AddDefaultRepositoryForGenericPrimaryKey(IServiceCollection services, Type entityType, Type repositoryImplementationType)
@ -41,29 +41,29 @@ namespace Microsoft.Extensions.DependencyInjection
} }
} }
private static void AddDefaultRepositoryForDefaultPrimaryKey(IServiceCollection services, Type entityType, Type repositoryImplementationType) //private static void AddDefaultRepositoryForDefaultPrimaryKey(IServiceCollection services, Type entityType, Type repositoryImplementationType)
{ //{
//IRepository<TEntity> // //IRepository<TEntity>
var repositoryInterfaceWithDefaultPrimaryKey = typeof(IRepository<>).MakeGenericType(entityType); // var repositoryInterfaceWithDefaultPrimaryKey = typeof(IRepository<>).MakeGenericType(entityType);
if (!repositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType)) // if (!repositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType))
{ // {
throw new AbpException($"Given repositoryImplementationType ({repositoryImplementationType}) must implement {repositoryInterfaceWithDefaultPrimaryKey}"); // throw new AbpException($"Given repositoryImplementationType ({repositoryImplementationType}) must implement {repositoryInterfaceWithDefaultPrimaryKey}");
} // }
services.TryAddTransient(repositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType); // services.TryAddTransient(repositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType);
//IQueryableRepository<TEntity> // //IQueryableRepository<TEntity>
var queryableRepositoryInterfaceWithDefaultPrimaryKey = typeof(IQueryableRepository<>).MakeGenericType(entityType); // var queryableRepositoryInterfaceWithDefaultPrimaryKey = typeof(IQueryableRepository<>).MakeGenericType(entityType);
if (queryableRepositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType)) // if (queryableRepositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType))
{ // {
services.TryAddTransient(queryableRepositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType); // services.TryAddTransient(queryableRepositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType);
} // }
} //}
private static bool BothSupportsDefaultPrimaryKey(Type entityType, Type repositoryImplementationType) //private static bool BothSupportsDefaultPrimaryKey(Type entityType, Type repositoryImplementationType)
{ //{
return typeof(IEntity<Guid>).GetTypeInfo().IsAssignableFrom(entityType) && // return typeof(IEntity<Guid>).GetTypeInfo().IsAssignableFrom(entityType) &&
ReflectionHelper.IsAssignableToGenericType(repositoryImplementationType, typeof(IRepository<>)); // ReflectionHelper.IsAssignableToGenericType(repositoryImplementationType, typeof(IRepository<>));
} //}
} }
} }

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

@ -4,7 +4,6 @@ using System.Linq.Dynamic.Core;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
namespace Volo.Abp.Application.Services namespace Volo.Abp.Application.Services
{ {

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

@ -1,16 +1,8 @@
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
namespace Volo.Abp.Application.Services namespace Volo.Abp.Application.Services
{ {
public interface IAsyncCrudAppService<TEntityDto>
: IAsyncCrudAppService<TEntityDto, Guid>
where TEntityDto : IEntityDto<Guid>
{
}
public interface IAsyncCrudAppService<TEntityDto, in TPrimaryKey> public interface IAsyncCrudAppService<TEntityDto, in TPrimaryKey>
: IAsyncCrudAppService<TEntityDto, TPrimaryKey, PagedAndSortedResultRequestDto> : IAsyncCrudAppService<TEntityDto, TPrimaryKey, PagedAndSortedResultRequestDto>
where TEntityDto : IEntityDto<TPrimaryKey> where TEntityDto : IEntityDto<TPrimaryKey>

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

@ -20,7 +20,7 @@ namespace Volo.Abp.DependencyInjection
public Type DefaultRepositoryImplementationType { get; private set; } public Type DefaultRepositoryImplementationType { get; private set; }
public Type DefaultRepositoryImplementationTypeWithDefaultPrimaryKey { get; private set; } //public Type DefaultRepositoryImplementationTypeWithDefaultPrimaryKey { get; private set; }
public bool RegisterDefaultRepositories { get; private set; } public bool RegisterDefaultRepositories { get; private set; }
@ -28,7 +28,7 @@ namespace Volo.Abp.DependencyInjection
public Dictionary<Type, Type> CustomRepositories { get; } public Dictionary<Type, Type> CustomRepositories { get; }
public bool SpecifiedDefaultRepositoryTypes => DefaultRepositoryImplementationType != null && DefaultRepositoryImplementationTypeWithDefaultPrimaryKey != null; public bool SpecifiedDefaultRepositoryTypes => DefaultRepositoryImplementationType != null; // && DefaultRepositoryImplementationTypeWithDefaultPrimaryKey != null;
protected CommonDbContextRegistrationOptions(Type originalDbContextType) protected CommonDbContextRegistrationOptions(Type originalDbContextType)
{ {
@ -87,13 +87,11 @@ namespace Volo.Abp.DependencyInjection
return this; return this;
} }
public ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses([NotNull] Type repositoryImplementationType, [NotNull] Type repositoryImplementationTypeWithDefaultPrimaryKey) public ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses([NotNull] Type repositoryImplementationType)
{ {
Check.NotNull(repositoryImplementationType, nameof(repositoryImplementationType)); Check.NotNull(repositoryImplementationType, nameof(repositoryImplementationType));
Check.NotNull(repositoryImplementationTypeWithDefaultPrimaryKey, nameof(repositoryImplementationTypeWithDefaultPrimaryKey));
DefaultRepositoryImplementationType = repositoryImplementationType; DefaultRepositoryImplementationType = repositoryImplementationType;
DefaultRepositoryImplementationTypeWithDefaultPrimaryKey = repositoryImplementationTypeWithDefaultPrimaryKey;
return this; return this;
} }

3
src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/ICommonDbContextRegistrationOptionsBuilder.cs

@ -47,9 +47,8 @@ namespace Volo.Abp.DependencyInjection
/// Uses given class(es) for default repositories. /// Uses given class(es) for default repositories.
/// </summary> /// </summary>
/// <param name="repositoryImplementationType">Repository implementation type</param> /// <param name="repositoryImplementationType">Repository implementation type</param>
/// <param name="repositoryImplementationTypeWithDefaultPrimaryKey">Repository implementation type for default primary key type (<see cref="string"/>)</param>
/// <returns></returns> /// <returns></returns>
ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses(Type repositoryImplementationType, Type repositoryImplementationTypeWithDefaultPrimaryKey); ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses(Type repositoryImplementationType);
/// <summary> /// <summary>
/// Replaces given DbContext type with this DbContext type. /// Replaces given DbContext type with this DbContext type.

6
src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/AggregateRoot.cs

@ -2,10 +2,10 @@
namespace Volo.Abp.Domain.Entities namespace Volo.Abp.Domain.Entities
{ {
public abstract class AggregateRoot : AggregateRoot<Guid>, IAggregateRoot //public abstract class AggregateRoot : AggregateRoot<Guid>, IAggregateRoot
{ //{
} //}
public abstract class AggregateRoot<TPrimaryKey> : Entity<TPrimaryKey>, IAggregateRoot<TPrimaryKey> public abstract class AggregateRoot<TPrimaryKey> : Entity<TPrimaryKey>, IAggregateRoot<TPrimaryKey>
{ {

12
src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs

@ -3,13 +3,13 @@ using System.Reflection;
namespace Volo.Abp.Domain.Entities namespace Volo.Abp.Domain.Entities
{ {
/// <summary> ///// <summary>
/// A shortcut of <see cref="Entity{TPrimaryKey}"/> for default primary key type (<see cref="Guid"/>). ///// A shortcut of <see cref="Entity{TPrimaryKey}"/> for default primary key type (<see cref="Guid"/>).
/// </summary> ///// </summary>
public abstract class Entity : Entity<Guid>, IEntity //public abstract class Entity : Entity<Guid>, IEntity
{ //{
} //}
/// <inheritdoc/> /// <inheritdoc/>
/// <summary> /// <summary>

6
src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IAggregateRoot.cs

@ -2,10 +2,10 @@
namespace Volo.Abp.Domain.Entities namespace Volo.Abp.Domain.Entities
{ {
public interface IAggregateRoot : IAggregateRoot<Guid>, IEntity //public interface IAggregateRoot : IAggregateRoot<Guid>, IEntity
{ //{
} //}
public interface IAggregateRoot<TPrimaryKey> : IEntity<TPrimaryKey> public interface IAggregateRoot<TPrimaryKey> : IEntity<TPrimaryKey>
{ {

12
src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IEntity.cs

@ -2,13 +2,13 @@
namespace Volo.Abp.Domain.Entities namespace Volo.Abp.Domain.Entities
{ {
/// <summary> ///// <summary>
/// A shortcut of <see cref="IEntity{TPrimaryKey}"/> for default primary key type (<see cref="string"/>). ///// A shortcut of <see cref="IEntity{TPrimaryKey}"/> for default primary key type (<see cref="string"/>).
/// </summary> ///// </summary>
public interface IEntity : IEntity<Guid> //public interface IEntity : IEntity<Guid>
{ //{
} //}
/// <summary> /// <summary>
/// Defines interface for base entity type. All entities in the system must implement this interface. /// Defines interface for base entity type. All entities in the system must implement this interface.

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

@ -8,11 +8,11 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories namespace Volo.Abp.Domain.Repositories
{ {
public interface IQueryableRepository<TEntity> : IQueryableRepository<TEntity, Guid>, IRepository<TEntity> //public interface IQueryableRepository<TEntity> : IQueryableRepository<TEntity, Guid>, IRepository<TEntity>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public interface IQueryableRepository<TEntity, TPrimaryKey> : IRepository<TEntity, TPrimaryKey>, IQueryable<TEntity> public interface IQueryableRepository<TEntity, TPrimaryKey> : IRepository<TEntity, TPrimaryKey>, IQueryable<TEntity>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

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

@ -13,11 +13,11 @@ namespace Volo.Abp.Domain.Repositories
} }
public interface IRepository<TEntity> : IRepository<TEntity, Guid> //public interface IRepository<TEntity> : IRepository<TEntity, Guid>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public interface IRepository<TEntity, TPrimaryKey> : IRepository public interface IRepository<TEntity, TPrimaryKey> : IRepository
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

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

@ -11,11 +11,11 @@ using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Domain.Repositories namespace Volo.Abp.Domain.Repositories
{ {
public abstract class QueryableRepositoryBase<TEntity> : QueryableRepositoryBase<TEntity, Guid>, IQueryableRepository<TEntity> //public abstract class QueryableRepositoryBase<TEntity> : QueryableRepositoryBase<TEntity, Guid>, IQueryableRepository<TEntity>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public abstract class QueryableRepositoryBase<TEntity, TPrimaryKey> : RepositoryBase<TEntity, TPrimaryKey>, IQueryableRepository<TEntity, TPrimaryKey> public abstract class QueryableRepositoryBase<TEntity, TPrimaryKey> : RepositoryBase<TEntity, TPrimaryKey>, IQueryableRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

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

@ -8,11 +8,11 @@ using Volo.Abp.Threading;
namespace Volo.Abp.Domain.Repositories namespace Volo.Abp.Domain.Repositories
{ {
public abstract class RepositoryBase<TEntity> : RepositoryBase<TEntity, Guid>, IRepository<TEntity> //public abstract class RepositoryBase<TEntity> : RepositoryBase<TEntity, Guid>, IRepository<TEntity>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public abstract class RepositoryBase<TEntity, TPrimaryKey> : IRepository<TEntity, TPrimaryKey> public abstract class RepositoryBase<TEntity, TPrimaryKey> : IRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

18
src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs

@ -46,20 +46,22 @@ namespace Volo.Abp.Domain.Repositories
protected void RegisterDefaultRepository(IServiceCollection services, Type entityType) protected void RegisterDefaultRepository(IServiceCollection services, Type entityType)
{ {
var primaryKeyType = EntityHelper.GetPrimaryKeyType(entityType); var primaryKeyType = EntityHelper.GetPrimaryKeyType(entityType);
var isDefaultPrimaryKey = primaryKeyType == typeof(Guid); //var isDefaultPrimaryKey = primaryKeyType == typeof(Guid);
Type repositoryImplementationType; Type repositoryImplementationType;
if (Options.SpecifiedDefaultRepositoryTypes) if (Options.SpecifiedDefaultRepositoryTypes)
{ {
repositoryImplementationType = isDefaultPrimaryKey repositoryImplementationType = Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType);
? Options.DefaultRepositoryImplementationTypeWithDefaultPrimaryKey.MakeGenericType(entityType) //repositoryImplementationType = isDefaultPrimaryKey
: Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType); // ? Options.DefaultRepositoryImplementationTypeWithDefaultPrimaryKey.MakeGenericType(entityType)
// : Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType);
} }
else else
{ {
repositoryImplementationType = isDefaultPrimaryKey repositoryImplementationType = GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType);
? GetRepositoryTypeForDefaultPk(Options.DefaultRepositoryDbContextType, entityType) //repositoryImplementationType = isDefaultPrimaryKey
: GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType); // ? GetRepositoryTypeForDefaultPk(Options.DefaultRepositoryDbContextType, entityType)
// : GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType);
} }
services.AddDefaultRepository(entityType, repositoryImplementationType); services.AddDefaultRepository(entityType, repositoryImplementationType);
@ -87,7 +89,7 @@ namespace Volo.Abp.Domain.Repositories
protected abstract IEnumerable<Type> GetEntityTypes(Type dbContextType); protected abstract IEnumerable<Type> GetEntityTypes(Type dbContextType);
protected abstract Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType); //protected abstract Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType);
protected abstract Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType); protected abstract Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType);
} }

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

@ -11,15 +11,15 @@ using Volo.Abp.Threading;
namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore
{ {
public class EfCoreRepository<TDbContext, TEntity> : EfCoreRepository<TDbContext, TEntity, Guid>, IEfCoreRepository<TEntity> //public class EfCoreRepository<TDbContext, TEntity> : EfCoreRepository<TDbContext, TEntity, Guid>, IEfCoreRepository<TEntity>
where TDbContext : IEfCoreDbContext // where TDbContext : IEfCoreDbContext
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
public EfCoreRepository(IDbContextProvider<TDbContext> dbContextProvider) // public EfCoreRepository(IDbContextProvider<TDbContext> dbContextProvider)
: base(dbContextProvider) // : base(dbContextProvider)
{ // {
} // }
} //}
public class EfCoreRepository<TDbContext, TEntity, TPrimaryKey> : QueryableRepositoryBase<TEntity, TPrimaryKey>, public class EfCoreRepository<TDbContext, TEntity, TPrimaryKey> : QueryableRepositoryBase<TEntity, TPrimaryKey>,
IEfCoreRepository<TEntity, TPrimaryKey>, IEfCoreRepository<TEntity, TPrimaryKey>,

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

@ -4,11 +4,11 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore
{ {
public interface IEfCoreRepository<TEntity> : IEfCoreRepository<TEntity, Guid>, IQueryableRepository<TEntity> //public interface IEfCoreRepository<TEntity> : IEfCoreRepository<TEntity, Guid>, IQueryableRepository<TEntity>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public interface IEfCoreRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey> public interface IEfCoreRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

8
src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/EfCoreRepositoryRegistrar.cs

@ -17,10 +17,10 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection
return DbContextHelper.GetEntityTypes(dbContextType); return DbContextHelper.GetEntityTypes(dbContextType);
} }
protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) //protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType)
{ //{
return typeof(EfCoreRepository<,>).MakeGenericType(dbContextType, entityType); // return typeof(EfCoreRepository<,>).MakeGenericType(dbContextType, entityType);
} //}
protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType)
{ {

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

@ -4,11 +4,11 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories.MemoryDb namespace Volo.Abp.Domain.Repositories.MemoryDb
{ {
public interface IMemoryDbRepository<TEntity> : IMemoryDbRepository<TEntity, Guid>, IQueryableRepository<TEntity> //public interface IMemoryDbRepository<TEntity> : IMemoryDbRepository<TEntity, Guid>, IQueryableRepository<TEntity>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public interface IMemoryDbRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey> public interface IMemoryDbRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

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

@ -6,15 +6,15 @@ using Volo.Abp.MemoryDb;
namespace Volo.Abp.Domain.Repositories.MemoryDb namespace Volo.Abp.Domain.Repositories.MemoryDb
{ {
public class MemoryDbRepository<TMemoryDbContext, TEntity> : MemoryDbRepository<TMemoryDbContext, TEntity, Guid>, IMemoryDbRepository<TEntity> //public class MemoryDbRepository<TMemoryDbContext, TEntity> : MemoryDbRepository<TMemoryDbContext, TEntity, Guid>, IMemoryDbRepository<TEntity>
where TMemoryDbContext : MemoryDbContext // where TMemoryDbContext : MemoryDbContext
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
public MemoryDbRepository(IMemoryDatabaseProvider<TMemoryDbContext> databaseProvider) // public MemoryDbRepository(IMemoryDatabaseProvider<TMemoryDbContext> databaseProvider)
: base(databaseProvider) // : base(databaseProvider)
{ // {
} // }
} //}
public class MemoryDbRepository<TMemoryDbContext, TEntity, TPrimaryKey> : QueryableRepositoryBase<TEntity, TPrimaryKey>, IMemoryDbRepository<TEntity, TPrimaryKey> public class MemoryDbRepository<TMemoryDbContext, TEntity, TPrimaryKey> : QueryableRepositoryBase<TEntity, TPrimaryKey>, IMemoryDbRepository<TEntity, TPrimaryKey>
where TMemoryDbContext : MemoryDbContext where TMemoryDbContext : MemoryDbContext

5
src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/DependencyInjection/MemoryDbRepositoryRegistrar.cs

@ -18,11 +18,6 @@ namespace Volo.Abp.MemoryDb.DependencyInjection
return memoryDbContext.GetEntityTypes(); return memoryDbContext.GetEntityTypes();
} }
protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType)
{
return typeof(MemoryDbRepository<,>).MakeGenericType(dbContextType, entityType);
}
protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType)
{ {
return typeof(MemoryDbRepository<,,>).MakeGenericType(dbContextType, entityType, primaryKeyType); return typeof(MemoryDbRepository<,,>).MakeGenericType(dbContextType, entityType, primaryKeyType);

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

@ -4,11 +4,11 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.Domain.Repositories.MongoDB namespace Volo.Abp.Domain.Repositories.MongoDB
{ {
public interface IMongoDbRepository<TEntity> : IMongoDbRepository<TEntity, Guid>, IQueryableRepository<TEntity> //public interface IMongoDbRepository<TEntity> : IMongoDbRepository<TEntity, Guid>, IQueryableRepository<TEntity>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public interface IMongoDbRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey> public interface IMongoDbRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>

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

@ -10,15 +10,15 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.Domain.Repositories.MongoDB namespace Volo.Abp.Domain.Repositories.MongoDB
{ {
public class MongoDbRepository<TMongoDbContext, TEntity> : MongoDbRepository<TMongoDbContext, TEntity, Guid>, IMongoDbRepository<TEntity> //public class MongoDbRepository<TMongoDbContext, TEntity> : MongoDbRepository<TMongoDbContext, TEntity, Guid>, IMongoDbRepository<TEntity>
where TMongoDbContext : AbpMongoDbContext // where TMongoDbContext : AbpMongoDbContext
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
public MongoDbRepository(IMongoDatabaseProvider<TMongoDbContext> databaseProvider) // public MongoDbRepository(IMongoDatabaseProvider<TMongoDbContext> databaseProvider)
: base(databaseProvider) // : base(databaseProvider)
{ // {
} // }
} //}
public class MongoDbRepository<TMongoDbContext, TEntity, TPrimaryKey> : QueryableRepositoryBase<TEntity, TPrimaryKey>, IMongoDbRepository<TEntity, TPrimaryKey> public class MongoDbRepository<TMongoDbContext, TEntity, TPrimaryKey> : QueryableRepositoryBase<TEntity, TPrimaryKey>, IMongoDbRepository<TEntity, TPrimaryKey>
where TMongoDbContext : AbpMongoDbContext where TMongoDbContext : AbpMongoDbContext

5
src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/MongoDbRepositoryRegistrar.cs

@ -19,11 +19,6 @@ namespace Volo.Abp.MongoDB.DependencyInjection
return mongoDbContext.GetMappings().Select(m => m.EntityType); return mongoDbContext.GetMappings().Select(m => m.EntityType);
} }
protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType)
{
return typeof(MongoDbRepository<,>).MakeGenericType(dbContextType, entityType);
}
protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType)
{ {
return typeof(MongoDbRepository<,,>).MakeGenericType(dbContextType, entityType, primaryKeyType); return typeof(MongoDbRepository<,,>).MakeGenericType(dbContextType, entityType, primaryKeyType);

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

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

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

@ -25,9 +25,9 @@ namespace Volo.Abp.Domain.Repositories
//Assert //Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk>)); //services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk>)); services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldNotContainService(typeof(IRepository<MyTestEntityWithCustomPk, int>)); services.ShouldNotContainService(typeof(IRepository<MyTestEntityWithInt32Pk, int>));
} }
[Fact] [Fact]
@ -46,9 +46,9 @@ namespace Volo.Abp.Domain.Repositories
//Assert //Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk>)); //services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk>)); services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithCustomPk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithCustomPk, int>)); services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
} }
[Fact] [Fact]
@ -61,7 +61,7 @@ namespace Volo.Abp.Domain.Repositories
var options = new TestDbContextRegistrationOptions(typeof(MyFakeDbContext)); var options = new TestDbContextRegistrationOptions(typeof(MyFakeDbContext));
options options
.AddDefaultRepositories(true) .AddDefaultRepositories(true)
.AddCustomRepository<MyTestAggregateRootWithDefaultPk, MyTestAggregateRootWithDefaultPkCustomRepository>(); .AddCustomRepository<MyTestAggregateRootWithGuidPk, MyTestAggregateRootWithDefaultPkCustomRepository>();
//Act //Act
@ -69,9 +69,9 @@ namespace Volo.Abp.Domain.Repositories
//Assert //Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); //services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk, Guid>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestAggregateRootWithDefaultPkCustomRepository));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithCustomPk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithCustomPk, int>)); services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestDefaultRepository<MyTestEntityWithInt32Pk, int>));
} }
[Fact] [Fact]
@ -84,7 +84,7 @@ namespace Volo.Abp.Domain.Repositories
var options = new TestDbContextRegistrationOptions(typeof(MyFakeDbContext)); var options = new TestDbContextRegistrationOptions(typeof(MyFakeDbContext));
options options
.AddDefaultRepositories(true) .AddDefaultRepositories(true)
.SetDefaultRepositoryClasses(typeof(MyTestCustomBaseRepository<,>), typeof(MyTestCustomBaseRepository<>)); .SetDefaultRepositoryClasses(typeof(MyTestCustomBaseRepository<,>));
//Act //Act
@ -92,9 +92,9 @@ namespace Volo.Abp.Domain.Repositories
//Assert //Assert
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithDefaultPk>)); //services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithDefaultPk>));
services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithDefaultPk, Guid>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithDefaultPk>)); services.ShouldContainTransient(typeof(IRepository<MyTestAggregateRootWithGuidPk, Guid>), typeof(MyTestCustomBaseRepository<MyTestAggregateRootWithGuidPk, Guid>));
services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithCustomPk, int>), typeof(MyTestCustomBaseRepository<MyTestEntityWithCustomPk, int>)); services.ShouldContainTransient(typeof(IRepository<MyTestEntityWithInt32Pk, int>), typeof(MyTestCustomBaseRepository<MyTestEntityWithInt32Pk, int>));
} }
public class MyTestRepositoryRegistrar : RepositoryRegistrarBase<CommonDbContextRegistrationOptions> public class MyTestRepositoryRegistrar : RepositoryRegistrarBase<CommonDbContextRegistrationOptions>
@ -108,15 +108,15 @@ namespace Volo.Abp.Domain.Repositories
{ {
return new[] return new[]
{ {
typeof(MyTestEntityWithCustomPk), typeof(MyTestEntityWithInt32Pk),
typeof(MyTestAggregateRootWithDefaultPk) typeof(MyTestAggregateRootWithGuidPk)
}; };
} }
protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) //protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType)
{ //{
return typeof(MyTestDefaultRepository<>).MakeGenericType(entityType); // return typeof(MyTestDefaultRepository<>).MakeGenericType(entityType);
} //}
protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType)
{ {
@ -126,21 +126,21 @@ namespace Volo.Abp.Domain.Repositories
public class MyFakeDbContext { } public class MyFakeDbContext { }
public class MyTestAggregateRootWithDefaultPk : AggregateRoot<Guid> public class MyTestAggregateRootWithGuidPk : AggregateRoot<Guid>
{ {
} }
public class MyTestEntityWithCustomPk : Entity<int> public class MyTestEntityWithInt32Pk : Entity<int>
{ {
} }
public class MyTestDefaultRepository<TEntity> : MyTestDefaultRepository<TEntity, Guid> //public class MyTestDefaultRepository<TEntity> : MyTestDefaultRepository<TEntity, Guid>
where TEntity : class, IEntity<Guid> // where TEntity : class, IEntity<Guid>
{ //{
} //}
public class MyTestDefaultRepository<TEntity, TPrimaryKey> : RepositoryBase<TEntity, TPrimaryKey> public class MyTestDefaultRepository<TEntity, TPrimaryKey> : RepositoryBase<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey> where TEntity : class, IEntity<TPrimaryKey>
@ -176,13 +176,7 @@ namespace Volo.Abp.Domain.Repositories
} }
} }
public class MyTestAggregateRootWithDefaultPkCustomRepository : MyTestDefaultRepository<MyTestAggregateRootWithDefaultPk> public class MyTestAggregateRootWithDefaultPkCustomRepository : MyTestDefaultRepository<MyTestAggregateRootWithGuidPk, Guid>
{
}
public class MyTestCustomBaseRepository<TEntity> : MyTestCustomBaseRepository<TEntity, Guid>
where TEntity : class, IEntity<Guid>
{ {
} }

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

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

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

@ -1,4 +1,5 @@
using System.Linq; using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Shouldly; using Shouldly;
using Volo.Abp.Data; using Volo.Abp.Data;
@ -10,12 +11,12 @@ namespace Volo.Abp.MemoryDb.DataFilters
{ {
public class MemoryDb_SoftDelete_DataFilter_Tests : MemoryDbTestBase public class MemoryDb_SoftDelete_DataFilter_Tests : MemoryDbTestBase
{ {
private readonly IQueryableRepository<Person> _personRepository; private readonly IQueryableRepository<Person, Guid> _personRepository;
private readonly IDataFilter _dataFilter; private readonly IDataFilter _dataFilter;
public MemoryDb_SoftDelete_DataFilter_Tests() public MemoryDb_SoftDelete_DataFilter_Tests()
{ {
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person>>(); _personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
_dataFilter = GetRequiredService<IDataFilter>(); _dataFilter = GetRequiredService<IDataFilter>();
} }

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 public class MemoryDb_Basic_Repository_Tests : MemoryDbTestBase
{ {
private readonly IQueryableRepository<Person> _personRepository; private readonly IQueryableRepository<Person, Guid> _personRepository;
public MemoryDb_Basic_Repository_Tests() public MemoryDb_Basic_Repository_Tests()
{ {
_personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person>>(); _personRepository = ServiceProvider.GetRequiredService<IQueryableRepository<Person, Guid>>();
} }
[Fact] [Fact]

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

@ -6,7 +6,7 @@ using Volo.Abp.TestApp.Application.Dto;
namespace Volo.Abp.TestApp.Application namespace Volo.Abp.TestApp.Application
{ {
public interface IPeopleAppService : IAsyncCrudAppService<PersonDto> public interface IPeopleAppService : IAsyncCrudAppService<PersonDto, Guid>
{ {
Task<ListResultDto<PhoneDto>> GetPhones(Guid id, GetPersonPhonesFilter filter); Task<ListResultDto<PhoneDto>> GetPhones(Guid id, GetPersonPhonesFilter filter);

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>, IPeopleAppService public class PeopleAppService : AsyncCrudAppService<Person, PersonDto>, IPeopleAppService
{ {
public PeopleAppService(IQueryableRepository<Person> repository) public PeopleAppService(IQueryableRepository<Person, Guid> repository)
: base(repository) : base(repository)
{ {

Loading…
Cancel
Save