diff --git a/Directory.Build.props b/Directory.Build.props index dea0a6c6f7..94e58ab692 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,15 +3,15 @@ 5.0.0 - + - 16.6.1 + 16.8.3 4.2.2 - 3.0.2 + 4.0.1 2.4.1 @@ -20,7 +20,7 @@ 2.4.1 - 2.4.2 + 2.4.3 2.2.14 diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj index 208cfa1376..ad0066db55 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj index fde96ac65c..53e3c7f503 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo.Abp.AspNetCore.Mvc.csproj @@ -29,7 +29,7 @@ - + diff --git a/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj b/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj index bd5cffe848..9f028d31ee 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj +++ b/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj @@ -21,7 +21,7 @@ - + diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs index 024fc3a258..a51637e3e7 100644 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs +++ b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacRegistration.cs @@ -1,6 +1,6 @@ // This software is part of the Autofac IoC container // Copyright © 2015 Autofac Contributors -// http://autofac.org +// https://autofac.org // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation @@ -24,9 +24,12 @@ // OTHER DEALINGS IN THE SOFTWARE. using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using Autofac.Builder; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; using Volo.Abp.Modularity; namespace Autofac.Extensions.DependencyInjection @@ -45,16 +48,62 @@ namespace Autofac.Extensions.DependencyInjection /// The into which the registrations should be made. /// /// - /// The set of service descriptors to register in the container. + /// A container builder that can be used to create an . /// public static void Populate( - this ContainerBuilder builder, - IServiceCollection services) + this ContainerBuilder builder, + IServiceCollection services) { - builder.RegisterType().As(); - builder.RegisterType().As(); + Populate(builder, services, null); + } + + /// + /// Populates the Autofac container builder with the set of registered service descriptors + /// and makes and + /// available in the container. Using this overload is incompatible with the ASP.NET Core + /// support for . + /// + /// + /// The into which the registrations should be made. + /// + /// + /// A container builder that can be used to create an . + /// + /// + /// If provided and not then all registrations with lifetime are registered + /// using + /// with provided + /// instead of using . + /// + /// + /// + /// Specifying a addresses a specific case where you have + /// an application that uses Autofac but where you need to isolate a set of services in a child scope. For example, + /// if you have a large application that self-hosts ASP.NET Core items, you may want to isolate the ASP.NET + /// Core registrations in a child lifetime scope so they don't show up for the rest of the application. + /// This overload allows that. Note it is the developer's responsibility to execute this and create an + /// using the child lifetime scope. + /// + /// + public static void Populate( + this ContainerBuilder builder, + IServiceCollection services, + object lifetimeScopeTagForSingletons) + { + if (services == null) + { + throw new ArgumentNullException(nameof(services)); + } - Register(builder, services); + builder.RegisterType().As().ExternallyOwned(); + var autofacServiceScopeFactory = typeof(AutofacServiceProvider).Assembly.GetType("Autofac.Extensions.DependencyInjection.AutofacServiceScopeFactory"); + if (autofacServiceScopeFactory == null) + { + throw new AbpException("Unable get type of Autofac.Extensions.DependencyInjection.AutofacServiceScopeFactory"); + } + builder.RegisterType(autofacServiceScopeFactory).As(); + + Register(builder, services, lifetimeScopeTagForSingletons); } /// @@ -64,18 +113,33 @@ namespace Autofac.Extensions.DependencyInjection /// The object registration style. /// The registration being built. /// The lifecycle specified on the service registration. + /// + /// If not then all registrations with lifetime are registered + /// using + /// with provided + /// instead of using . + /// /// /// The , configured with the proper lifetime scope, /// and available for additional configuration. /// private static IRegistrationBuilder ConfigureLifecycle( - this IRegistrationBuilder registrationBuilder, - ServiceLifetime lifecycleKind) + this IRegistrationBuilder registrationBuilder, + ServiceLifetime lifecycleKind, + object lifetimeScopeTagForSingleton) { switch (lifecycleKind) { case ServiceLifetime.Singleton: - registrationBuilder.SingleInstance(); + if (lifetimeScopeTagForSingleton == null) + { + registrationBuilder.SingleInstance(); + } + else + { + registrationBuilder.InstancePerMatchingLifetimeScope(lifetimeScopeTagForSingleton); + } + break; case ServiceLifetime.Scoped: registrationBuilder.InstancePerLifetimeScope(); @@ -95,57 +159,65 @@ namespace Autofac.Extensions.DependencyInjection /// The into which the registrations should be made. /// /// - /// The set of service descriptors to register in the container. + /// A container builder that can be used to create an . + /// + /// + /// If not then all registrations with lifetime are registered + /// using + /// with provided + /// instead of using . /// + [SuppressMessage("CA2000", "CA2000", Justification = "Registrations created here are disposed when the built container is disposed.")] private static void Register( - ContainerBuilder builder, - IServiceCollection services) + ContainerBuilder builder, + IServiceCollection services, + object lifetimeScopeTagForSingletons) { var moduleContainer = services.GetSingletonInstance(); var registrationActionList = services.GetRegistrationActionList(); - foreach (var service in services) + foreach (var descriptor in services) { - if (service.ImplementationType != null) + if (descriptor.ImplementationType != null) { // Test if the an open generic type is being registered - var serviceTypeInfo = service.ServiceType.GetTypeInfo(); + var serviceTypeInfo = descriptor.ServiceType.GetTypeInfo(); if (serviceTypeInfo.IsGenericTypeDefinition) { builder - .RegisterGeneric(service.ImplementationType) - .As(service.ServiceType) - .ConfigureLifecycle(service.Lifetime) + .RegisterGeneric(descriptor.ImplementationType) + .As(descriptor.ServiceType) + .ConfigureLifecycle(descriptor.Lifetime, lifetimeScopeTagForSingletons) .ConfigureAbpConventions(moduleContainer, registrationActionList); } else { builder - .RegisterType(service.ImplementationType) - .As(service.ServiceType) - .ConfigureLifecycle(service.Lifetime) + .RegisterType(descriptor.ImplementationType) + .As(descriptor.ServiceType) + .ConfigureLifecycle(descriptor.Lifetime, lifetimeScopeTagForSingletons) .ConfigureAbpConventions(moduleContainer, registrationActionList); } } - else if (service.ImplementationFactory != null) + else if (descriptor.ImplementationFactory != null) { - var registration = RegistrationBuilder.ForDelegate(service.ServiceType, (context, parameters) => - { - var serviceProvider = context.Resolve(); - return service.ImplementationFactory(serviceProvider); - }) - .ConfigureLifecycle(service.Lifetime) - .CreateRegistration(); - //TODO: ConfigureAbpConventions ? + var registration = RegistrationBuilder.ForDelegate(descriptor.ServiceType, (context, parameters) => + { + var serviceProvider = context.Resolve(); + return descriptor.ImplementationFactory(serviceProvider); + }) + .ConfigureLifecycle(descriptor.Lifetime, lifetimeScopeTagForSingletons) + .CreateRegistration(); + //TODO: ConfigureAbpConventions ? builder.RegisterComponent(registration); } else { builder - .RegisterInstance(service.ImplementationInstance) - .As(service.ServiceType) - .ConfigureLifecycle(service.Lifetime); + .RegisterInstance(descriptor.ImplementationInstance) + .As(descriptor.ServiceType) + .ConfigureLifecycle(descriptor.Lifetime, null); } } } diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs deleted file mode 100644 index 1c1a24ff66..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProvider.cs +++ /dev/null @@ -1,122 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2015 Autofac Contributors -// https://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// Autofac implementation of the ASP.NET Core . - /// - /// - /// - public class AutofacServiceProvider : IServiceProvider, ISupportRequiredService, IDisposable - { - private readonly ILifetimeScope _lifetimeScope; - - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The lifetime scope from which services will be resolved. - /// - public AutofacServiceProvider(ILifetimeScope lifetimeScope) - { - this._lifetimeScope = lifetimeScope; - } - - /// - /// Gets service of type from the - /// and requires it be present. - /// - /// - /// An object that specifies the type of service object to get. - /// - /// - /// A service object of type . - /// - /// - /// Thrown if the isn't registered with the container. - /// - /// - /// Thrown if the object can't be resolved from the container. - /// - public object GetRequiredService(Type serviceType) - { - return this._lifetimeScope.Resolve(serviceType); - } - - /// - /// Gets the service object of the specified type. - /// - /// - /// An object that specifies the type of service object to get. - /// - /// - /// A service object of type ; or - /// if there is no service object of type . - /// - public object GetService(Type serviceType) - { - return this._lifetimeScope.ResolveOptional(serviceType); - } - - /// - /// Gets the underlying instance of . - /// - public ILifetimeScope LifetimeScope => _lifetimeScope; - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// - /// to release both managed and unmanaged resources; - /// to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!this._disposed) - { - this._disposed = true; - if (disposing) - { - this._lifetimeScope.Dispose(); - } - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs deleted file mode 100644 index 21a7ca331d..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceProviderFactory.cs +++ /dev/null @@ -1,77 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2017 Autofac Contributors -// http://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// A factory for creating a and an . - /// - public class AutofacServiceProviderFactory : IServiceProviderFactory - { - private readonly Action _configurationAction; - - /// - /// Initializes a new instance of the class. - /// - /// Action on a that adds component registrations to the container. - public AutofacServiceProviderFactory(Action configurationAction = null) - { - _configurationAction = configurationAction ?? (builder => { }); - } - - /// - /// Creates a container builder from an . - /// - /// The collection of services - /// A container builder that can be used to create an . - public ContainerBuilder CreateBuilder(IServiceCollection services) - { - var builder = new ContainerBuilder(); - - builder.Populate(services); - - _configurationAction(builder); - - return builder; - } - - /// - /// Creates an from the container builder. - /// - /// The container builder - /// An - public IServiceProvider CreateServiceProvider(ContainerBuilder containerBuilder) - { - if (containerBuilder == null) throw new ArgumentNullException(nameof(containerBuilder)); - - var container = containerBuilder.Build(); - - return new AutofacServiceProvider(container); - } - } -} diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs deleted file mode 100644 index 425c6769da..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScope.cs +++ /dev/null @@ -1,67 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2015 Autofac Contributors -// http://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// Autofac implementation of the ASP.NET Core . - /// - /// - internal class AutofacServiceScope : IServiceScope - { - private readonly ILifetimeScope _lifetimeScope; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The lifetime scope from which services should be resolved for this service scope. - /// - public AutofacServiceScope(ILifetimeScope lifetimeScope) - { - this._lifetimeScope = lifetimeScope; - this.ServiceProvider = this._lifetimeScope.Resolve(); - } - - /// - /// Gets an corresponding to this service scope. - /// - /// - /// An that can be used to resolve dependencies from the scope. - /// - public IServiceProvider ServiceProvider { get; } - - /// - /// Disposes of the lifetime scope and resolved disposable services. - /// - public void Dispose() - { - this._lifetimeScope.Dispose(); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs b/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs deleted file mode 100644 index 31917fd079..0000000000 --- a/framework/src/Volo.Abp.Autofac/Autofac/Extensions/DependencyInjection/AutofacServiceScopeFactory.cs +++ /dev/null @@ -1,65 +0,0 @@ -// This software is part of the Autofac IoC container -// Copyright © 2015 Autofac Contributors -// http://autofac.org -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -using System.Diagnostics.CodeAnalysis; -using Microsoft.Extensions.DependencyInjection; - -namespace Autofac.Extensions.DependencyInjection -{ - /// - /// Autofac implementation of the ASP.NET Core . - /// - /// - [SuppressMessage("Microsoft.ApiDesignGuidelines", "CA2213", Justification = "The creator of the root service lifetime scope is responsible for disposal.")] - internal class AutofacServiceScopeFactory : IServiceScopeFactory - { - private readonly ILifetimeScope _lifetimeScope; - - /// - /// Initializes a new instance of the class. - /// - /// The lifetime scope. - public AutofacServiceScopeFactory(ILifetimeScope lifetimeScope) - { - this._lifetimeScope = lifetimeScope; - } - - /// - /// Creates an which contains an - /// used to resolve dependencies within - /// the scope. - /// - /// - /// An controlling the lifetime of the scope. Once - /// this is disposed, any scoped services that have been resolved - /// from the - /// will also be disposed. - /// - public IServiceScope CreateScope() - { - return new AutofacServiceScope(this._lifetimeScope.BeginLifetimeScope()); - } - } -} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj b/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj index 2032464676..b33c9a3b66 100644 --- a/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj +++ b/framework/src/Volo.Abp.Autofac/Volo.Abp.Autofac.csproj @@ -15,8 +15,10 @@ - - + + + + diff --git a/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj b/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj index f3f8249f50..25c486d79f 100644 --- a/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj +++ b/framework/src/Volo.Abp.BlobStoring.Aliyun/Volo.Abp.BlobStoring.Aliyun.csproj @@ -16,7 +16,7 @@ - + diff --git a/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj b/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj index 796da8aa26..d36d2bfbf3 100644 --- a/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj +++ b/framework/src/Volo.Abp.BlobStoring.Aws/Volo.Abp.BlobStoring.Aws.csproj @@ -17,8 +17,8 @@ - - + + diff --git a/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj b/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj index 6434e1d43c..73a8116e46 100644 --- a/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj +++ b/framework/src/Volo.Abp.BlobStoring.Azure/Volo.Abp.BlobStoring.Azure.csproj @@ -16,7 +16,7 @@ - + diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj index 13f81e730b..c9ea67209f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj +++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj @@ -15,10 +15,10 @@ - - - - + + + + diff --git a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj index 887929dfa3..3926f8f298 100644 --- a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj +++ b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj @@ -26,10 +26,10 @@ - + - - - + + + diff --git a/framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj b/framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj index a2fd749d0e..0e267324af 100644 --- a/framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj +++ b/framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj @@ -19,7 +19,7 @@ - + diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj index 8e325342d4..8616838cc0 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo.Abp.EntityFrameworkCore.PostgreSql.csproj @@ -19,7 +19,7 @@ - + diff --git a/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj b/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj index 68ce50ec9d..772774a77e 100644 --- a/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj +++ b/framework/src/Volo.Abp.FluentValidation/Volo.Abp.FluentValidation.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.FluentValidation/Volo/Abp/FluentValidation/FluentObjectValidationContributor.cs b/framework/src/Volo.Abp.FluentValidation/Volo/Abp/FluentValidation/FluentObjectValidationContributor.cs index e699e0093a..ccc290f354 100644 --- a/framework/src/Volo.Abp.FluentValidation/Volo/Abp/FluentValidation/FluentObjectValidationContributor.cs +++ b/framework/src/Volo.Abp.FluentValidation/Volo/Abp/FluentValidation/FluentObjectValidationContributor.cs @@ -26,7 +26,10 @@ namespace Volo.Abp.FluentValidation return; } - var result = validator.Validate(context.ValidatingObject); + var result = validator.Validate((IValidationContext) Activator.CreateInstance( + typeof(ValidationContext<>).MakeGenericType(context.ValidatingObject.GetType()), + context.ValidatingObject)); + if (!result.IsValid) { context.Errors.AddRange( diff --git a/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj b/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj index 3bd6638f67..7c45741326 100644 --- a/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj +++ b/framework/src/Volo.Abp.HangFire/Volo.Abp.HangFire.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj index 2000ca7ae4..9b1a1c9caf 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj +++ b/framework/src/Volo.Abp.IdentityModel/Volo.Abp.IdentityModel.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj b/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj index 2a0b576f98..4f8a94fe8e 100644 --- a/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj +++ b/framework/src/Volo.Abp.Kafka/Volo.Abp.Kafka.csproj @@ -9,7 +9,7 @@ - + diff --git a/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj b/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj index ddded71dce..edc3752d47 100644 --- a/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj +++ b/framework/src/Volo.Abp.MailKit/Volo.Abp.MailKit.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj b/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj index 1b2f266637..6f25c447f0 100644 --- a/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj +++ b/framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj @@ -19,7 +19,7 @@ - + diff --git a/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj b/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj index e2f589b399..aa487ffc4e 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj +++ b/framework/src/Volo.Abp.MongoDB/Volo.Abp.MongoDB.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj b/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj index 198d2479e4..0fcc4da9f2 100644 --- a/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj +++ b/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj b/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj index a21be8bdfa..abec7828ab 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj +++ b/framework/src/Volo.Abp.RabbitMQ/Volo.Abp.RabbitMQ.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj b/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj index bbd09c5fed..e9d5e1afe5 100644 --- a/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj +++ b/framework/src/Volo.Abp.Swashbuckle/Volo.Abp.Swashbuckle.csproj @@ -2,7 +2,7 @@ - + netstandard2.0 Volo.Abp.Swashbuckle @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj b/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj index 7885cefbaf..af14f9e42e 100644 --- a/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj +++ b/framework/src/Volo.Abp.TextTemplating/Volo.Abp.TextTemplating.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateLocalizer.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateLocalizer.cs index c3c67dd194..4e4a1e4833 100644 --- a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateLocalizer.cs +++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/TemplateLocalizer.cs @@ -46,5 +46,20 @@ namespace Volo.Abp.TextTemplating var args = arguments.Skip(1).Where(x => x != null && !x.ToString().IsNullOrWhiteSpace()).ToArray(); return args.Any() ? _localizer[name.ToString(), args] : _localizer[name.ToString()]; } + + public int RequiredParameterCount => 1; + + public int ParameterCount => ScriptFunctionCall.MaximumParameterCount - 1; + + public ScriptVarParamKind VarParamKind => ScriptVarParamKind.Direct; + + public Type ReturnType => typeof(object); + + public ScriptParameterInfo GetParameterInfo(int index) + { + return index == 0 + ? new ScriptParameterInfo(typeof(string), "template_name") + : new ScriptParameterInfo(typeof(object), "value"); + } } } diff --git a/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj b/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj index 53ef23fd62..c0a9f0b271 100644 --- a/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj +++ b/framework/src/Volo.Abp.Timing/Volo.Abp.Timing.csproj @@ -26,7 +26,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj index c5bc024d75..7fa17a9fe7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj @@ -9,7 +9,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj index 7c105c4de3..fb39407b4b 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj @@ -16,7 +16,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo.Abp.AspNetCore.Serilog.Tests.csproj b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo.Abp.AspNetCore.Serilog.Tests.csproj index 432ece07dd..9c96018145 100644 --- a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo.Abp.AspNetCore.Serilog.Tests.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo.Abp.AspNetCore.Serilog.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/Serilog/Serilog_Enrichers_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/Serilog/Serilog_Enrichers_Tests.cs index 77de765f51..7bea930a37 100644 --- a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/Serilog/Serilog_Enrichers_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/Serilog/Serilog_Enrichers_Tests.cs @@ -88,10 +88,10 @@ namespace Volo.Abp.AspNetCore.Serilog executedLogEvent.ShouldNotBeNull(); executedLogEvent.Properties.ContainsKey(_serilogOptions.EnricherPropertyNames.CorrelationId) - .ShouldNotBeNull(); + .ShouldBeTrue(); ((ScalarValue) executedLogEvent.Properties[_serilogOptions.EnricherPropertyNames.CorrelationId]).Value .ShouldBe(result); } } -} \ No newline at end of file +} diff --git a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs index aae01ff912..e453c5ee96 100644 --- a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs +++ b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs @@ -33,7 +33,7 @@ namespace Volo.Abp.VirtualFileSystem Encoding.UTF8.GetString(stream.GetAllBytes()).ShouldBe("//jquery-3-1-1-min.js-contents"); } } - + [Fact] public void Should_Define_And_Get_Embedded_Resources_With_Special_Chars() { @@ -57,10 +57,10 @@ namespace Volo.Abp.VirtualFileSystem var contents = _virtualFileProvider.GetDirectoryContents("/js"); //Assert - contents.Exists.ShouldNotBeNull(); + contents.Exists.ShouldBeTrue(); var contentList = contents.ToList(); - + contentList.ShouldContain(x => x.Name == "jquery-3-1-1-min.js"); contentList.ShouldContain(x => x.Name == "my{test}.2.9.min.js"); } @@ -74,7 +74,7 @@ namespace Volo.Abp.VirtualFileSystem var contents = _virtualFileProvider.GetDirectoryContents(path); //Assert - contents.Exists.ShouldNotBeNull(); + contents.Exists.ShouldBeTrue(); var contentList = contents.ToList(); contentList.ShouldContain(x => x.Name == "js"); diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj index bcfd855190..91f9a3022e 100644 --- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj +++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj @@ -34,7 +34,7 @@ - + diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj index c4ea6d9eb4..dc433de11d 100644 --- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj index 0f5bd720a1..a9ac493329 100644 --- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj @@ -6,7 +6,7 @@ - + diff --git a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj index 3e11d85aee..41176d3edd 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj +++ b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj @@ -15,9 +15,9 @@ - + - + diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj index 8c9f39e023..308a0b8c31 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj +++ b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj @@ -11,7 +11,7 @@ - + diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj index cc27807686..dbf58f3b71 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/Volo.CmsKit.HttpApi.Host.csproj b/modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/Volo.CmsKit.HttpApi.Host.csproj index d019896648..ed25471452 100644 --- a/modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/Volo.CmsKit.HttpApi.Host.csproj +++ b/modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/Volo.CmsKit.HttpApi.Host.csproj @@ -10,9 +10,9 @@ - + - + diff --git a/modules/cms-kit/host/Volo.CmsKit.IdentityServer/Volo.CmsKit.IdentityServer.csproj b/modules/cms-kit/host/Volo.CmsKit.IdentityServer/Volo.CmsKit.IdentityServer.csproj index fb149e574f..9f7ebc55d9 100644 --- a/modules/cms-kit/host/Volo.CmsKit.IdentityServer/Volo.CmsKit.IdentityServer.csproj +++ b/modules/cms-kit/host/Volo.CmsKit.IdentityServer/Volo.CmsKit.IdentityServer.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Host/Volo.CmsKit.Web.Host.csproj b/modules/cms-kit/host/Volo.CmsKit.Web.Host/Volo.CmsKit.Web.Host.csproj index 23a4b9fae3..3072fb471f 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Host/Volo.CmsKit.Web.Host.csproj +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Host/Volo.CmsKit.Web.Host.csproj @@ -10,7 +10,7 @@ - + diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj index 70f6923cfc..4cbfb26d9c 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj @@ -10,7 +10,7 @@ - + diff --git a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj index 8244c9b6fd..854744ab0c 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj +++ b/modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj index 8561d8b72d..90d738f09e 100644 --- a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj +++ b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj @@ -23,7 +23,7 @@ - + diff --git a/modules/identityserver/common.props b/modules/identityserver/common.props index 7f5a705307..3e213d5368 100644 --- a/modules/identityserver/common.props +++ b/modules/identityserver/common.props @@ -9,8 +9,4 @@ https://github.com/volosoft/abp/ - - - - \ No newline at end of file diff --git a/modules/virtual-file-explorer/app/Volo.Abp.VirtualFileExplorer.DemoApp/Volo.Abp.VirtualFileExplorer.DemoApp.csproj b/modules/virtual-file-explorer/app/Volo.Abp.VirtualFileExplorer.DemoApp/Volo.Abp.VirtualFileExplorer.DemoApp.csproj index 6cfb1efc40..b1c78debfd 100644 --- a/modules/virtual-file-explorer/app/Volo.Abp.VirtualFileExplorer.DemoApp/Volo.Abp.VirtualFileExplorer.DemoApp.csproj +++ b/modules/virtual-file-explorer/app/Volo.Abp.VirtualFileExplorer.DemoApp/Volo.Abp.VirtualFileExplorer.DemoApp.csproj @@ -6,7 +6,7 @@ - +