diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs index 5d664d7a0d..c0bf2e9556 100644 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs +++ b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/BlogPostLister.cs @@ -9,11 +9,11 @@ namespace AbpDesk.ConsoleDemo { public class BlogPostLister : ITransientDependency { - private readonly IQueryableRepository _blogPostRepository; + private readonly IQueryableRepository _blogPostRepository; private readonly IGuidGenerator _guidGenerator; public BlogPostLister( - IQueryableRepository blogPostRepository, + IQueryableRepository blogPostRepository, IGuidGenerator guidGenerator) { _blogPostRepository = blogPostRepository; diff --git a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs b/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs index 51a5a8f1e0..46b038c511 100644 --- a/src/AbpDesk/AbpDesk.ConsoleDemo/AbpDesk/ConsoleDemo/UserLister.cs +++ b/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 _userRepository; + private readonly IQueryableRepository _userRepository; public UserLister( IdentityUserManager userManager, - IQueryableRepository userRepository) + IQueryableRepository userRepository) { _userManager = userManager; _userRepository = userRepository; diff --git a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs b/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs index 8e5df159d1..90e0b6b1cc 100644 --- a/src/AbpDesk/AbpDesk.MongoBlog/AbpDesk/Blogging/AbpDeskMongoBlogModule.cs +++ b/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.Logging; using Volo.Abp; @@ -46,7 +47,7 @@ namespace AbpDesk.Blogging using (var uow = scope.ServiceProvider.GetRequiredService().Begin()) { - var blogPostRepository = scope.ServiceProvider.GetRequiredService>(); + var blogPostRepository = scope.ServiceProvider.GetRequiredService>(); if (blogPostRepository.Any()) { logger.LogInformation($"No need to seed database since there are already {blogPostRepository.Count()} blog posts!"); diff --git a/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs b/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs index 64e0dcf640..ec761ebfe4 100644 --- a/src/AbpDesk/AbpDesk.MongoBlog/Areas/Blog/Controllers/PostsController.cs +++ b/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 Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; @@ -9,9 +10,9 @@ namespace Areas.Blog.Controllers [Area("Blog")] public class PostsController : AbpController { - private readonly IQueryableRepository _blogPostRepository; + private readonly IQueryableRepository _blogPostRepository; - public PostsController(IQueryableRepository blogPostRepository) + public PostsController(IQueryableRepository blogPostRepository) { _blogPostRepository = blogPostRepository; } diff --git a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll index a6bb0c90e4..e18ffa8870 100644 Binary files a/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll and b/src/AbpDesk/Web_PlugIns/AbpDesk.MongoBlog.dll differ diff --git a/src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs b/src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs index 12b0a3dbba..34f16efc34 100644 --- a/src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs +++ b/src/Volo.Abp.Ddd/Microsoft/Extensions/DependencyInjection/ServiceCollectionRepositoryExtensions.cs @@ -14,10 +14,10 @@ namespace Microsoft.Extensions.DependencyInjection { AddDefaultRepositoryForGenericPrimaryKey(services, entityType, repositoryImplementationType); - if (BothSupportsDefaultPrimaryKey(entityType, repositoryImplementationType)) - { - AddDefaultRepositoryForDefaultPrimaryKey(services, entityType, repositoryImplementationType); - } + //if (BothSupportsDefaultPrimaryKey(entityType, repositoryImplementationType)) + //{ + // AddDefaultRepositoryForDefaultPrimaryKey(services, entityType, 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) - { - //IRepository - var repositoryInterfaceWithDefaultPrimaryKey = typeof(IRepository<>).MakeGenericType(entityType); - if (!repositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType)) - { - throw new AbpException($"Given repositoryImplementationType ({repositoryImplementationType}) must implement {repositoryInterfaceWithDefaultPrimaryKey}"); - } + //private static void AddDefaultRepositoryForDefaultPrimaryKey(IServiceCollection services, Type entityType, Type repositoryImplementationType) + //{ + // //IRepository + // var repositoryInterfaceWithDefaultPrimaryKey = typeof(IRepository<>).MakeGenericType(entityType); + // if (!repositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType)) + // { + // throw new AbpException($"Given repositoryImplementationType ({repositoryImplementationType}) must implement {repositoryInterfaceWithDefaultPrimaryKey}"); + // } - services.TryAddTransient(repositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType); + // services.TryAddTransient(repositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType); - //IQueryableRepository - var queryableRepositoryInterfaceWithDefaultPrimaryKey = typeof(IQueryableRepository<>).MakeGenericType(entityType); - if (queryableRepositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType)) - { - services.TryAddTransient(queryableRepositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType); - } - } + // //IQueryableRepository + // var queryableRepositoryInterfaceWithDefaultPrimaryKey = typeof(IQueryableRepository<>).MakeGenericType(entityType); + // if (queryableRepositoryInterfaceWithDefaultPrimaryKey.GetTypeInfo().IsAssignableFrom(repositoryImplementationType)) + // { + // services.TryAddTransient(queryableRepositoryInterfaceWithDefaultPrimaryKey, repositoryImplementationType); + // } + //} - private static bool BothSupportsDefaultPrimaryKey(Type entityType, Type repositoryImplementationType) - { - return typeof(IEntity).GetTypeInfo().IsAssignableFrom(entityType) && - ReflectionHelper.IsAssignableToGenericType(repositoryImplementationType, typeof(IRepository<>)); - } + //private static bool BothSupportsDefaultPrimaryKey(Type entityType, Type repositoryImplementationType) + //{ + // return typeof(IEntity).GetTypeInfo().IsAssignableFrom(entityType) && + // ReflectionHelper.IsAssignableToGenericType(repositoryImplementationType, typeof(IRepository<>)); + //} } } \ No newline at end of file diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppServiceBase.cs b/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppServiceBase.cs index 3cdff642f1..ec04a532ab 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/CrudAppServiceBase.cs +++ b/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.Domain.Entities; using Volo.Abp.Domain.Repositories; -using Volo.Abp.ObjectMapping; namespace Volo.Abp.Application.Services { diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/IAsyncCrudAppService.cs b/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/IAsyncCrudAppService.cs index a94d0ce554..37c8293df4 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/IAsyncCrudAppService.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Application/Services/IAsyncCrudAppService.cs @@ -1,16 +1,8 @@ -using System; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; namespace Volo.Abp.Application.Services { - public interface IAsyncCrudAppService - : IAsyncCrudAppService - where TEntityDto : IEntityDto - { - - } - public interface IAsyncCrudAppService : IAsyncCrudAppService where TEntityDto : IEntityDto diff --git a/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/CommonDbContextRegistrationOptions.cs b/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/CommonDbContextRegistrationOptions.cs index 99f087c54d..cced597bd4 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/CommonDbContextRegistrationOptions.cs +++ b/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 DefaultRepositoryImplementationTypeWithDefaultPrimaryKey { get; private set; } + //public Type DefaultRepositoryImplementationTypeWithDefaultPrimaryKey { get; private set; } public bool RegisterDefaultRepositories { get; private set; } @@ -28,7 +28,7 @@ namespace Volo.Abp.DependencyInjection public Dictionary CustomRepositories { get; } - public bool SpecifiedDefaultRepositoryTypes => DefaultRepositoryImplementationType != null && DefaultRepositoryImplementationTypeWithDefaultPrimaryKey != null; + public bool SpecifiedDefaultRepositoryTypes => DefaultRepositoryImplementationType != null; // && DefaultRepositoryImplementationTypeWithDefaultPrimaryKey != null; protected CommonDbContextRegistrationOptions(Type originalDbContextType) { @@ -87,13 +87,11 @@ namespace Volo.Abp.DependencyInjection return this; } - public ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses([NotNull] Type repositoryImplementationType, [NotNull] Type repositoryImplementationTypeWithDefaultPrimaryKey) + public ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses([NotNull] Type repositoryImplementationType) { Check.NotNull(repositoryImplementationType, nameof(repositoryImplementationType)); - Check.NotNull(repositoryImplementationTypeWithDefaultPrimaryKey, nameof(repositoryImplementationTypeWithDefaultPrimaryKey)); DefaultRepositoryImplementationType = repositoryImplementationType; - DefaultRepositoryImplementationTypeWithDefaultPrimaryKey = repositoryImplementationTypeWithDefaultPrimaryKey; return this; } diff --git a/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/ICommonDbContextRegistrationOptionsBuilder.cs b/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/ICommonDbContextRegistrationOptionsBuilder.cs index f15509dfbe..b78c2d7e67 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/ICommonDbContextRegistrationOptionsBuilder.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/DependencyInjection/ICommonDbContextRegistrationOptionsBuilder.cs @@ -47,9 +47,8 @@ namespace Volo.Abp.DependencyInjection /// Uses given class(es) for default repositories. /// /// Repository implementation type - /// Repository implementation type for default primary key type () /// - ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses(Type repositoryImplementationType, Type repositoryImplementationTypeWithDefaultPrimaryKey); + ICommonDbContextRegistrationOptionsBuilder SetDefaultRepositoryClasses(Type repositoryImplementationType); /// /// Replaces given DbContext type with this DbContext type. diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/AggregateRoot.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/AggregateRoot.cs index 3c8d2771f5..58940bc7af 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/AggregateRoot.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/AggregateRoot.cs @@ -2,10 +2,10 @@ namespace Volo.Abp.Domain.Entities { - public abstract class AggregateRoot : AggregateRoot, IAggregateRoot - { + //public abstract class AggregateRoot : AggregateRoot, IAggregateRoot + //{ - } + //} public abstract class AggregateRoot : Entity, IAggregateRoot { diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs index 7b09c60baa..6cc3303565 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs @@ -3,13 +3,13 @@ using System.Reflection; namespace Volo.Abp.Domain.Entities { - /// - /// A shortcut of for default primary key type (). - /// - public abstract class Entity : Entity, IEntity - { + ///// + ///// A shortcut of for default primary key type (). + ///// + //public abstract class Entity : Entity, IEntity + //{ - } + //} /// /// diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IAggregateRoot.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IAggregateRoot.cs index 9ef287eb68..adb3f11d60 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IAggregateRoot.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IAggregateRoot.cs @@ -2,10 +2,10 @@ namespace Volo.Abp.Domain.Entities { - public interface IAggregateRoot : IAggregateRoot, IEntity - { + //public interface IAggregateRoot : IAggregateRoot, IEntity + //{ - } + //} public interface IAggregateRoot : IEntity { diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IEntity.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IEntity.cs index 9534c6c38d..ff798a8253 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IEntity.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/IEntity.cs @@ -2,13 +2,13 @@ namespace Volo.Abp.Domain.Entities { - /// - /// A shortcut of for default primary key type (). - /// - public interface IEntity : IEntity - { + ///// + ///// A shortcut of for default primary key type (). + ///// + //public interface IEntity : IEntity + //{ - } + //} /// /// Defines interface for base entity type. All entities in the system must implement this interface. diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs index 53e65ce336..08bb61a442 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IQueryableRepository.cs @@ -8,11 +8,11 @@ using Volo.Abp.Domain.Entities; namespace Volo.Abp.Domain.Repositories { - public interface IQueryableRepository : IQueryableRepository, IRepository - where TEntity : class, IEntity - { + //public interface IQueryableRepository : IQueryableRepository, IRepository + // where TEntity : class, IEntity + //{ - } + //} public interface IQueryableRepository : IRepository, IQueryable where TEntity : class, IEntity diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs index 2af29b9cbc..f2bc729011 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/IRepository.cs @@ -13,11 +13,11 @@ namespace Volo.Abp.Domain.Repositories } - public interface IRepository : IRepository - where TEntity : class, IEntity - { + //public interface IRepository : IRepository + // where TEntity : class, IEntity + //{ - } + //} public interface IRepository : IRepository where TEntity : class, IEntity diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs index d75d4b8f13..8bdc50b4b3 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/QueryableRepositoryBase.cs @@ -11,11 +11,11 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.Domain.Repositories { - public abstract class QueryableRepositoryBase : QueryableRepositoryBase, IQueryableRepository - where TEntity : class, IEntity - { + //public abstract class QueryableRepositoryBase : QueryableRepositoryBase, IQueryableRepository + // where TEntity : class, IEntity + //{ - } + //} public abstract class QueryableRepositoryBase : RepositoryBase, IQueryableRepository where TEntity : class, IEntity diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs index 062d130ad0..a1c890c600 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryBase.cs @@ -8,11 +8,11 @@ using Volo.Abp.Threading; namespace Volo.Abp.Domain.Repositories { - public abstract class RepositoryBase : RepositoryBase, IRepository - where TEntity : class, IEntity - { + //public abstract class RepositoryBase : RepositoryBase, IRepository + // where TEntity : class, IEntity + //{ - } + //} public abstract class RepositoryBase : IRepository where TEntity : class, IEntity diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs index ea3e1963f8..544da02f10 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs +++ b/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) { var primaryKeyType = EntityHelper.GetPrimaryKeyType(entityType); - var isDefaultPrimaryKey = primaryKeyType == typeof(Guid); + //var isDefaultPrimaryKey = primaryKeyType == typeof(Guid); Type repositoryImplementationType; if (Options.SpecifiedDefaultRepositoryTypes) { - repositoryImplementationType = isDefaultPrimaryKey - ? Options.DefaultRepositoryImplementationTypeWithDefaultPrimaryKey.MakeGenericType(entityType) - : Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType); + repositoryImplementationType = Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType); + //repositoryImplementationType = isDefaultPrimaryKey + // ? Options.DefaultRepositoryImplementationTypeWithDefaultPrimaryKey.MakeGenericType(entityType) + // : Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType); } else { - repositoryImplementationType = isDefaultPrimaryKey - ? GetRepositoryTypeForDefaultPk(Options.DefaultRepositoryDbContextType, entityType) - : GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType); + repositoryImplementationType = GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType); + //repositoryImplementationType = isDefaultPrimaryKey + // ? GetRepositoryTypeForDefaultPk(Options.DefaultRepositoryDbContextType, entityType) + // : GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType); } services.AddDefaultRepository(entityType, repositoryImplementationType); @@ -87,7 +89,7 @@ namespace Volo.Abp.Domain.Repositories protected abstract IEnumerable 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); } diff --git a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 869d090176..07047bd69b 100644 --- a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/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 { - public class EfCoreRepository : EfCoreRepository, IEfCoreRepository - where TDbContext : IEfCoreDbContext - where TEntity : class, IEntity - { - public EfCoreRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - } + //public class EfCoreRepository : EfCoreRepository, IEfCoreRepository + // where TDbContext : IEfCoreDbContext + // where TEntity : class, IEntity + //{ + // public EfCoreRepository(IDbContextProvider dbContextProvider) + // : base(dbContextProvider) + // { + // } + //} public class EfCoreRepository : QueryableRepositoryBase, IEfCoreRepository, diff --git a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs index e7e6ab171f..d32912d1d4 100644 --- a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreRepository.cs +++ b/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 { - public interface IEfCoreRepository : IEfCoreRepository, IQueryableRepository - where TEntity : class, IEntity - { + //public interface IEfCoreRepository : IEfCoreRepository, IQueryableRepository + // where TEntity : class, IEntity + //{ - } + //} public interface IEfCoreRepository : IQueryableRepository where TEntity : class, IEntity diff --git a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/EfCoreRepositoryRegistrar.cs b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/EfCoreRepositoryRegistrar.cs index f481fadc69..db0dcdc13f 100644 --- a/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/EfCoreRepositoryRegistrar.cs +++ b/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/EfCoreRepositoryRegistrar.cs @@ -17,10 +17,10 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection return DbContextHelper.GetEntityTypes(dbContextType); } - protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) - { - return typeof(EfCoreRepository<,>).MakeGenericType(dbContextType, entityType); - } + //protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) + //{ + // return typeof(EfCoreRepository<,>).MakeGenericType(dbContextType, entityType); + //} protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) { diff --git a/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/IMemoryDbRepository.cs b/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/IMemoryDbRepository.cs index 59f001195a..8eba8ede94 100644 --- a/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/IMemoryDbRepository.cs +++ b/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 { - public interface IMemoryDbRepository : IMemoryDbRepository, IQueryableRepository - where TEntity : class, IEntity - { + //public interface IMemoryDbRepository : IMemoryDbRepository, IQueryableRepository + // where TEntity : class, IEntity + //{ - } + //} public interface IMemoryDbRepository : IQueryableRepository where TEntity : class, IEntity diff --git a/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs b/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs index dcccdd6b07..bd2a03b4bb 100644 --- a/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs +++ b/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 { - public class MemoryDbRepository : MemoryDbRepository, IMemoryDbRepository - where TMemoryDbContext : MemoryDbContext - where TEntity : class, IEntity - { - public MemoryDbRepository(IMemoryDatabaseProvider databaseProvider) - : base(databaseProvider) - { - } - } + //public class MemoryDbRepository : MemoryDbRepository, IMemoryDbRepository + // where TMemoryDbContext : MemoryDbContext + // where TEntity : class, IEntity + //{ + // public MemoryDbRepository(IMemoryDatabaseProvider databaseProvider) + // : base(databaseProvider) + // { + // } + //} public class MemoryDbRepository : QueryableRepositoryBase, IMemoryDbRepository where TMemoryDbContext : MemoryDbContext diff --git a/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/DependencyInjection/MemoryDbRepositoryRegistrar.cs b/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/DependencyInjection/MemoryDbRepositoryRegistrar.cs index bf0d7dc011..08fa5d7a8f 100644 --- a/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/DependencyInjection/MemoryDbRepositoryRegistrar.cs +++ b/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/DependencyInjection/MemoryDbRepositoryRegistrar.cs @@ -18,11 +18,6 @@ namespace Volo.Abp.MemoryDb.DependencyInjection 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) { return typeof(MemoryDbRepository<,,>).MakeGenericType(dbContextType, entityType, primaryKeyType); diff --git a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs b/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs index 82ffb23f6b..e33d7116c5 100644 --- a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbRepository.cs +++ b/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 { - public interface IMongoDbRepository : IMongoDbRepository, IQueryableRepository - where TEntity : class, IEntity - { + //public interface IMongoDbRepository : IMongoDbRepository, IQueryableRepository + // where TEntity : class, IEntity + //{ - } + //} public interface IMongoDbRepository : IQueryableRepository where TEntity : class, IEntity diff --git a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index c18cb143b2..7ad3f6c29a 100644 --- a/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/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 { - public class MongoDbRepository : MongoDbRepository, IMongoDbRepository - where TMongoDbContext : AbpMongoDbContext - where TEntity : class, IEntity - { - public MongoDbRepository(IMongoDatabaseProvider databaseProvider) - : base(databaseProvider) - { - } - } + //public class MongoDbRepository : MongoDbRepository, IMongoDbRepository + // where TMongoDbContext : AbpMongoDbContext + // where TEntity : class, IEntity + //{ + // public MongoDbRepository(IMongoDatabaseProvider databaseProvider) + // : base(databaseProvider) + // { + // } + //} public class MongoDbRepository : QueryableRepositoryBase, IMongoDbRepository where TMongoDbContext : AbpMongoDbContext diff --git a/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/MongoDbRepositoryRegistrar.cs b/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/MongoDbRepositoryRegistrar.cs index 0ab8861ff5..9b94969a59 100644 --- a/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DependencyInjection/MongoDbRepositoryRegistrar.cs +++ b/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); } - protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) - { - return typeof(MongoDbRepository<,>).MakeGenericType(dbContextType, entityType); - } - protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) { return typeof(MongoDbRepository<,,>).MakeGenericType(dbContextType, entityType, primaryKeyType); diff --git a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs index 445e226de4..7c21ad6ee5 100644 --- a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PersonAppService_Tests.cs +++ b/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 { - private readonly IQueryableRepository _personRepository; + private readonly IQueryableRepository _personRepository; private readonly IJsonSerializer _jsonSerializer; private readonly IObjectMapper _objectMapper; public PersonAppService_Tests() { - _personRepository = ServiceProvider.GetRequiredService>(); + _personRepository = ServiceProvider.GetRequiredService>(); _jsonSerializer = ServiceProvider.GetRequiredService(); _objectMapper = ServiceProvider.GetRequiredService(); } diff --git a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs index 8a0f7ae652..c9ba7b5b29 100644 --- a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs +++ b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Repositories/RepositoryRegistration_Tests.cs @@ -25,9 +25,9 @@ namespace Volo.Abp.Domain.Repositories //Assert - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); - services.ShouldNotContainService(typeof(IRepository)); + //services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + services.ShouldNotContainService(typeof(IRepository)); } [Fact] @@ -46,9 +46,9 @@ namespace Volo.Abp.Domain.Repositories //Assert - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + //services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); } [Fact] @@ -61,7 +61,7 @@ namespace Volo.Abp.Domain.Repositories var options = new TestDbContextRegistrationOptions(typeof(MyFakeDbContext)); options .AddDefaultRepositories(true) - .AddCustomRepository(); + .AddCustomRepository(); //Act @@ -69,9 +69,9 @@ namespace Volo.Abp.Domain.Repositories //Assert - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); + //services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestAggregateRootWithDefaultPkCustomRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestDefaultRepository)); } [Fact] @@ -84,7 +84,7 @@ namespace Volo.Abp.Domain.Repositories var options = new TestDbContextRegistrationOptions(typeof(MyFakeDbContext)); options .AddDefaultRepositories(true) - .SetDefaultRepositoryClasses(typeof(MyTestCustomBaseRepository<,>), typeof(MyTestCustomBaseRepository<>)); + .SetDefaultRepositoryClasses(typeof(MyTestCustomBaseRepository<,>)); //Act @@ -92,9 +92,9 @@ namespace Volo.Abp.Domain.Repositories //Assert - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); - services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); + //services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); + services.ShouldContainTransient(typeof(IRepository), typeof(MyTestCustomBaseRepository)); } public class MyTestRepositoryRegistrar : RepositoryRegistrarBase @@ -108,15 +108,15 @@ namespace Volo.Abp.Domain.Repositories { return new[] { - typeof(MyTestEntityWithCustomPk), - typeof(MyTestAggregateRootWithDefaultPk) + typeof(MyTestEntityWithInt32Pk), + typeof(MyTestAggregateRootWithGuidPk) }; } - protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) - { - return typeof(MyTestDefaultRepository<>).MakeGenericType(entityType); - } + //protected override Type GetRepositoryTypeForDefaultPk(Type dbContextType, Type entityType) + //{ + // return typeof(MyTestDefaultRepository<>).MakeGenericType(entityType); + //} protected override Type GetRepositoryType(Type dbContextType, Type entityType, Type primaryKeyType) { @@ -126,21 +126,21 @@ namespace Volo.Abp.Domain.Repositories public class MyFakeDbContext { } - public class MyTestAggregateRootWithDefaultPk : AggregateRoot + public class MyTestAggregateRootWithGuidPk : AggregateRoot { } - public class MyTestEntityWithCustomPk : Entity + public class MyTestEntityWithInt32Pk : Entity { } - public class MyTestDefaultRepository : MyTestDefaultRepository - where TEntity : class, IEntity - { + //public class MyTestDefaultRepository : MyTestDefaultRepository + // where TEntity : class, IEntity + //{ - } + //} public class MyTestDefaultRepository : RepositoryBase where TEntity : class, IEntity @@ -176,13 +176,7 @@ namespace Volo.Abp.Domain.Repositories } } - public class MyTestAggregateRootWithDefaultPkCustomRepository : MyTestDefaultRepository - { - - } - - public class MyTestCustomBaseRepository : MyTestCustomBaseRepository - where TEntity : class, IEntity + public class MyTestAggregateRootWithDefaultPkCustomRepository : MyTestDefaultRepository { } diff --git a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs index 3eca23445e..b6a970e827 100644 --- a/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs +++ b/test/Volo.Abp.Identity.Tests/Volo/Abp/Identity/Initialize_Tests.cs @@ -27,10 +27,10 @@ namespace Volo.Abp.Identity (ServiceProvider.GetRequiredService() is EfCoreIdentityUserRepository).ShouldBeTrue(); (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); - (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); + //(ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); - (ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); + //(ServiceProvider.GetRequiredService>() is EfCoreIdentityUserRepository).ShouldBeTrue(); } } } diff --git a/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MemoryDb_SoftDelete_DataFilter_Tests.cs b/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MemoryDb_SoftDelete_DataFilter_Tests.cs index d627dfbabd..b3dc6cd4ed 100644 --- a/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/DataFilters/MemoryDb_SoftDelete_DataFilter_Tests.cs +++ b/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 Shouldly; using Volo.Abp.Data; @@ -10,12 +11,12 @@ namespace Volo.Abp.MemoryDb.DataFilters { public class MemoryDb_SoftDelete_DataFilter_Tests : MemoryDbTestBase { - private readonly IQueryableRepository _personRepository; + private readonly IQueryableRepository _personRepository; private readonly IDataFilter _dataFilter; public MemoryDb_SoftDelete_DataFilter_Tests() { - _personRepository = ServiceProvider.GetRequiredService>(); + _personRepository = ServiceProvider.GetRequiredService>(); _dataFilter = GetRequiredService(); } diff --git a/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/Repositories/MemoryDb_Basic_Repository_Tests.cs b/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/Repositories/MemoryDb_Basic_Repository_Tests.cs index 768460f0ba..9053d22363 100644 --- a/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/Repositories/MemoryDb_Basic_Repository_Tests.cs +++ b/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 _personRepository; + private readonly IQueryableRepository _personRepository; public MemoryDb_Basic_Repository_Tests() { - _personRepository = ServiceProvider.GetRequiredService>(); + _personRepository = ServiceProvider.GetRequiredService>(); } [Fact] diff --git a/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs b/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs index 9a0188d96d..e356d452a2 100644 --- a/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleAppService.cs +++ b/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 { - public interface IPeopleAppService : IAsyncCrudAppService + public interface IPeopleAppService : IAsyncCrudAppService { Task> GetPhones(Guid id, GetPersonPhonesFilter filter); diff --git a/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs b/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs index 0561f6fcef..7bc4ad087e 100644 --- a/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs +++ b/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleAppService.cs @@ -12,7 +12,7 @@ namespace Volo.Abp.TestApp.Application { public class PeopleAppService : AsyncCrudAppService, IPeopleAppService { - public PeopleAppService(IQueryableRepository repository) + public PeopleAppService(IQueryableRepository repository) : base(repository) {