├── extras
├── sample
│ ├── AspectCore.Extensions.AspNetCore.Sample
│ │ ├── wwwroot
│ │ │ ├── js
│ │ │ │ ├── site.min.js
│ │ │ │ └── site.js
│ │ │ ├── favicon.ico
│ │ │ ├── lib
│ │ │ │ ├── bootstrap
│ │ │ │ │ └── dist
│ │ │ │ │ │ ├── fonts
│ │ │ │ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ │ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ │ │ │ └── glyphicons-halflings-regular.woff2
│ │ │ │ │ │ └── js
│ │ │ │ │ │ └── npm.js
│ │ │ │ ├── jquery
│ │ │ │ │ └── .bower.json
│ │ │ │ └── jquery-validation
│ │ │ │ │ └── .bower.json
│ │ │ └── css
│ │ │ │ ├── site.min.css
│ │ │ │ └── site.css
│ │ ├── .bowerrc
│ │ ├── Views
│ │ │ ├── _ViewStart.cshtml
│ │ │ ├── Manage
│ │ │ │ ├── _ViewImports.cshtml
│ │ │ │ ├── _StatusMessage.cshtml
│ │ │ │ ├── _Layout.cshtml
│ │ │ │ ├── _ManageNav.cshtml
│ │ │ │ ├── GenerateRecoveryCodes.cshtml
│ │ │ │ ├── Disable2fa.cshtml
│ │ │ │ └── ResetAuthenticator.cshtml
│ │ │ ├── Account
│ │ │ │ ├── SignedOut.cshtml
│ │ │ │ ├── ConfirmEmail.cshtml
│ │ │ │ ├── ForgotPasswordConfirmation.cshtml
│ │ │ │ ├── AccessDenied.cshtml
│ │ │ │ ├── Lockout.cshtml
│ │ │ │ ├── ResetPasswordConfirmation.cshtml
│ │ │ │ ├── ForgotPassword.cshtml
│ │ │ │ └── LoginWithRecoveryCode.cshtml
│ │ │ ├── Home
│ │ │ │ ├── About.cshtml
│ │ │ │ └── Contact.cshtml
│ │ │ ├── _ViewImports.cshtml
│ │ │ └── Shared
│ │ │ │ ├── Error.cshtml
│ │ │ │ └── _LoginPartial.cshtml
│ │ ├── appsettings.Development.json
│ │ ├── bower.json
│ │ ├── Models
│ │ │ ├── ErrorViewModel.cs
│ │ │ ├── ApplicationUser.cs
│ │ │ ├── ManageViewModels
│ │ │ │ ├── GenerateRecoveryCodesViewModel.cs
│ │ │ │ ├── RemoveLoginViewModel.cs
│ │ │ │ ├── TwoFactorAuthenticationViewModel.cs
│ │ │ │ ├── ExternalLoginsViewModel.cs
│ │ │ │ ├── IndexViewModel.cs
│ │ │ │ ├── EnableAuthenticatorViewModel.cs
│ │ │ │ └── SetPasswordViewModel.cs
│ │ │ ├── AccountViewModels
│ │ │ │ ├── ExternalLoginViewModel.cs
│ │ │ │ ├── ForgotPasswordViewModel.cs
│ │ │ │ ├── LoginWithRecoveryCodeViewModel.cs
│ │ │ │ ├── LoginViewModel.cs
│ │ │ │ ├── LoginWith2faViewModel.cs
│ │ │ │ ├── ResetPasswordViewModel.cs
│ │ │ │ └── RegisterViewModel.cs
│ │ │ └── CreateBookViewModel.cs
│ │ ├── Services
│ │ │ ├── IBookService.cs
│ │ │ ├── IEmailSender.cs
│ │ │ ├── BookService.cs
│ │ │ └── EmailSender.cs
│ │ ├── appsettings.json
│ │ ├── Extensions
│ │ │ ├── EmailSenderExtensions.cs
│ │ │ └── UrlHelperExtensions.cs
│ │ ├── bundleconfig.json
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── Program.cs
│ │ ├── Controllers
│ │ │ └── HomeController.cs
│ │ └── Data
│ │ │ └── ApplicationDbContext.cs
│ ├── AspectCore.Extensions.Autofac.WebSample
│ │ ├── appsettings.json
│ │ ├── appsettings.Development.json
│ │ ├── Services
│ │ │ └── IValuesService.cs
│ │ ├── Program.cs
│ │ ├── AspectCore.Extensions.Autofac.WebSample.csproj
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ └── DynamicProxy
│ │ │ └── MethodExecuteLoggerInterceptor.cs
│ ├── AspectCore.Extensions.DependencyInjection.Sample
│ │ ├── appsettings.json
│ │ ├── appsettings.Development.json
│ │ ├── Services
│ │ │ └── IValuesService.cs
│ │ ├── Controllers
│ │ │ └── ControllerBase.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── AspectCore.Extensions.DependencyInjection.Sample.csproj
│ │ └── DynamicProxy
│ │ │ └── MethodExecuteLoggerInterceptor.cs
│ ├── AspectCore.Extensions.Autofac.Sample
│ │ ├── AspectCore.Extensions.Autofac.Sample.csproj
│ │ └── MethodExecuteLoggerInterceptor.cs
│ └── AspectCore.Extensions.DependencyInjection.ConsoleSample
│ │ └── AspectCore.Extensions.DependencyInjection.ConsoleSample.csproj
├── test
│ ├── AspectCore.Extensions.Windsor.Test
│ │ ├── Fakes
│ │ │ ├── IController.cs
│ │ │ ├── Model.cs
│ │ │ ├── ICacheService.cs
│ │ │ ├── Controller.cs
│ │ │ └── CacheService.cs
│ │ └── AspectCore.Extensions.Windsor.Test.csproj
│ ├── AspectCore.Extensions.Autofac.Test
│ │ ├── Fakes
│ │ │ ├── Service.cs
│ │ │ ├── IService.cs
│ │ │ ├── Model.cs
│ │ │ ├── IController.cs
│ │ │ └── Controller.cs
│ │ ├── SpecificationTests.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ ├── AspectCore.Extensions.Hosting.Tests
│ │ ├── FakeClasses.cs
│ │ └── AspectCore.Extensions.Hosting.Tests.csproj
│ └── AspectCore.Extensions.DependencyInjection.Test
│ │ ├── UseMicrosoftDISpecificationTests.cs
│ │ ├── Use_Built_In_ContainerSpecificationTests.cs
│ │ ├── SpecificationTests.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
└── src
│ ├── AspectCore.Extensions.AspNetCore
│ ├── Http
│ │ └── ExecutionContextHelper.cs
│ ├── Filters
│ │ └── ModelStateAdapterAttribute.cs
│ └── Extensions
│ │ ├── ConfigurationExtensions.cs
│ │ └── AspectContextExtensions.cs
│ ├── AspectCore.Extensions.DependencyInjection
│ ├── ServiceScopeFactory.cs
│ ├── DynamicProxyServiceProviderFactory.cs
│ ├── ServiceScope.cs
│ ├── MsdiScopeResolverFactory.cs
│ ├── AspectCoreServiceProviderFactory.cs
│ ├── SupportRequiredService.cs
│ ├── MsdiServiceResolver.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── AspectCore.Extensions.Autofac
│ ├── AutofacScopeResolverFactory.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── AutofacServiceResolver.cs
│ └── AspectCore.Extensions.Autofac.csproj
│ ├── AspectCore.Extensions.Hosting
│ └── AspectCore.Extensions.Hosting.csproj
│ └── AspectCore.Extensions.Windsor
│ ├── WindsorAspectBuilderFactory.cs
│ └── CompatibleCollectionResolver.cs
├── core
├── README.md
├── src
│ ├── AspectCore.Abstractions
│ │ ├── Configuration
│ │ │ ├── AspectPredicate.cs
│ │ │ ├── IAspectConfiguration.cs
│ │ │ ├── NonAspectPredicateCollection.cs
│ │ │ └── InterceptorCollection.cs
│ │ ├── DynamicProxy
│ │ │ ├── AspectDelegate.cs
│ │ │ ├── AspectValidationDelegate.cs
│ │ │ ├── IAspectActivatorFactory.cs
│ │ │ ├── IAspectValidatorBuilder.cs
│ │ │ ├── IAspectBuilderFactory.cs
│ │ │ ├── Parameters
│ │ │ │ ├── ParameterAspectDelegate.cs
│ │ │ │ ├── IParameterInterceptorSelector.cs
│ │ │ │ ├── IParameterInterceptor.cs
│ │ │ │ ├── ParameterInterceptorAttribute.cs
│ │ │ │ ├── ParameterAspectContext.cs
│ │ │ │ ├── ReturnParameterInterceptorAttribute.cs
│ │ │ │ └── ReturnParameter.cs
│ │ │ ├── AsyncAspectAttribute.cs
│ │ │ ├── IAspectValidator.cs
│ │ │ ├── IAspectCachingProvider.cs
│ │ │ ├── NonAspectAttribute.cs
│ │ │ ├── DynamicallyAttribute.cs
│ │ │ ├── IInterceptorSelector.cs
│ │ │ ├── IAspectContextFactory.cs
│ │ │ ├── IAspectValidationHandler.cs
│ │ │ ├── IAspectBuilder.cs
│ │ │ ├── IInterceptorCollector.cs
│ │ │ ├── IServiceInstanceAccessor.cs
│ │ │ ├── IInterceptor.cs
│ │ │ ├── IAspectCaching.cs
│ │ │ ├── IAdditionalInterceptorSelector.cs
│ │ │ ├── IProxyTypeGenerator.cs
│ │ │ ├── IAspectActivator.cs
│ │ │ ├── AbstractInterceptor.cs
│ │ │ ├── AspectInvocationException.cs
│ │ │ ├── IProxyGenerator.cs
│ │ │ ├── AbstractInterceptorAttribute.cs
│ │ │ ├── DelegateInterceptor.cs
│ │ │ ├── AspectActivatorContext.cs
│ │ │ ├── AspectContext.cs
│ │ │ └── AspectValidationContext.cs
│ │ ├── Injector
│ │ │ ├── IScopeResolverFactory.cs
│ │ │ ├── IPropertyInjector.cs
│ │ │ ├── ITransientServiceAccessor.cs
│ │ │ ├── IPropertyInjectorFactory.cs
│ │ │ ├── IServiceResolver.cs
│ │ │ ├── IManyEnumerable.cs
│ │ │ ├── FromContainerAttribute.cs
│ │ │ ├── ILifetimeServiceContainer.cs
│ │ │ ├── Definitions
│ │ │ │ ├── TypeServiceDefinition.cs
│ │ │ │ ├── ServiceDefinition.cs
│ │ │ │ ├── InstanceServiceDefinition.cs
│ │ │ │ └── DelegateServiceDefinition.cs
│ │ │ ├── ConfigurationExtensions.cs
│ │ │ ├── IServiceContainer.cs
│ │ │ └── Lifetime.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── AspectCore.Abstractions.csproj
│ └── AspectCore.Core
│ │ ├── Utils
│ │ ├── ArrayUtils.cs
│ │ ├── TaskUtils.cs
│ │ └── ActivatorUtils.cs
│ │ ├── Injector
│ │ ├── Extensions
│ │ │ ├── ServiceContainerBuildExtensions.cs
│ │ │ └── LinkedListExtensions.cs
│ │ ├── TransientServiceAccessor.cs
│ │ ├── ManyEnumerable.cs
│ │ ├── PropertyResolver.cs
│ │ ├── ScopeResolverFactory.cs
│ │ ├── PropertyInjectorFactory.cs
│ │ ├── ProxyServiceDefinition.cs
│ │ ├── EnumerableServiceDefintion.cs
│ │ └── PropertyInjector.cs
│ │ ├── DynamicProxy
│ │ ├── Parameters
│ │ │ ├── NotNullAttribute.cs
│ │ │ └── EnableParameterAspectExtensions.cs
│ │ ├── ValidationHandlers
│ │ │ ├── CacheAspectValidationHandler.cs
│ │ │ └── AttributeAspectValidationHandler.cs
│ │ ├── InterceptorSelectorEqualityComparer.cs
│ │ ├── AttributeInterceptorSelector.cs
│ │ ├── AspectActivatorFactory.cs
│ │ └── AspectCachingProvider.cs
│ │ ├── Configuration
│ │ ├── AspectConfiguration.cs
│ │ ├── Extensions
│ │ │ └── AspectValidationHandlerCollectionExtensions.cs
│ │ └── InterceptorFactories
│ │ │ └── DelegateInterceptorFactory.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── test
│ ├── AspectCore.Abstractions.Test
│ │ ├── Fakes
│ │ │ ├── ProxyService.cs
│ │ │ ├── IValidatorModel.cs
│ │ │ ├── ITargetService.cs
│ │ │ ├── InstanceSupportOriginalService.cs
│ │ │ ├── ItemInterceptorAttribute.cs
│ │ │ ├── OriginalServiceProvider.cs
│ │ │ ├── InstanceServiceProvider.cs
│ │ │ ├── TargetService.cs
│ │ │ ├── InjectedInterceptor.cs
│ │ │ ├── IncrementAttribute.cs
│ │ │ ├── MatcherTestAttribute.cs
│ │ │ ├── InterceptorMatcherModel.cs
│ │ │ ├── DescriptorWithParameter.cs
│ │ │ └── AspectValidatorFactory.cs
│ │ ├── ConfigurationOptionTest.cs
│ │ ├── MethodAccessorTest.cs
│ │ ├── ProxyDescriptorTest.cs
│ │ ├── project.json
│ │ ├── ReturnParameterDescriptorTest.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── AspectConfigurationTest.cs
│ │ ├── ServiceProviderAccessorTests.cs
│ │ ├── PropertyAccessorTest.cs
│ │ ├── MatchTest.cs
│ │ └── DynamicallyTests.cs
│ └── AspectCore.Tests
│ │ ├── AspectCore.Tests.csproj
│ │ ├── Injector
│ │ ├── InjectorTestBase.cs
│ │ └── TransientServiceAccessorTest.cs
│ │ ├── DynamicProxy
│ │ ├── DynamicProxyTestBase.cs
│ │ ├── OpenGenericMethodTests.cs
│ │ ├── AsyncAspectTests.cs
│ │ ├── ParameterInjectionTest.cs
│ │ └── ExplicitMethodTests.cs
│ │ └── Integrate
│ │ └── IntegrateTestBase.cs
└── performance
│ ├── AspectCore.Benchmark
│ ├── Program.cs
│ └── AspectCore.Benchmark.csproj
│ └── AspectCore.IoC.Benchmarks
│ ├── Program.cs
│ └── AspectCore.IoC.Benchmarks.csproj
├── reflection
├── src
│ └── AspectCore.Extensions.Reflection
│ │ ├── CallOptions.cs
│ │ ├── IParameterReflectorProvider.cs
│ │ ├── ICustomAttributeReflectorProvider.cs
│ │ ├── Factories
│ │ ├── CustomAttributeReflector.Factory.cs
│ │ ├── ParameterReflector.Factory.cs
│ │ ├── TypeReflector.Factory.cs
│ │ ├── ConstructorReflector.Factory.cs
│ │ └── FieldReflector.Factory.cs
│ │ ├── MemberReflector.CustomAttribute.cs
│ │ ├── Emit
│ │ └── IndexedLocalBuilder.cs
│ │ ├── ConstructorReflector.OpenGeneric.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Internals
│ │ └── ConstantsUtils.cs
│ │ └── MemberReflector.cs
├── README.md
├── performance
│ └── AspectCore.Extensions.Reflection.Benchmark
│ │ ├── Fakes
│ │ ├── FieldFakes.cs
│ │ ├── PropertyFakes.cs
│ │ ├── MethodFakes.cs
│ │ └── ConstructorFakes.cs
│ │ ├── AspectCore.Extensions.Reflection.Benchmark.csproj
│ │ └── Program.cs
└── test
│ └── AspectCore.Extensions.Reflection.Test
│ └── Properties
│ └── AssemblyInfo.cs
├── aspectscope
├── src
│ └── AspectCore.Extensions.AspectScope
│ │ ├── Scope.cs
│ │ ├── IScopeInterceptor.cs
│ │ ├── IAspectScheduler.cs
│ │ ├── ScopeInterceptorAttribute.cs
│ │ ├── ServiceContainerExtensions.cs
│ │ └── AspectCore.Extensions.AspectScope.csproj
└── sample
│ └── AspectCore.Extensions.AspectScope.Sample
│ └── AspectCore.Extensions.AspectScope.Sample.csproj
├── datavalidation
├── src
│ ├── AspectCore.Extensions.DataValidation
│ │ ├── SkipValidationAttribute.cs
│ │ ├── DataValidationState.cs
│ │ ├── IDataValidator.cs
│ │ ├── IDataStateFactory.cs
│ │ ├── IDataStateProvider.cs
│ │ ├── IPropertyValidator.cs
│ │ ├── IDataState.cs
│ │ ├── PropertyValidationContext.cs
│ │ ├── DataValidationContext.cs
│ │ ├── DataStateFactory.cs
│ │ ├── DataState.cs
│ │ ├── DataMetaData.cs
│ │ └── DataValidationError.cs
│ └── AspectCore.Extensions.DataAnnotations
│ │ ├── ServiceContainerExtensions.cs
│ │ └── AspectCore.Extensions.DataAnnotations.csproj
└── sample
│ └── AspectCore.Extensions.DataAnnotations.Sample
│ ├── AspectCore.Extensions.DataAnnotations.Sample.csproj
│ ├── RegisterInput.cs
│ └── IAccountService.cs
├── NuGet.config
├── appveyor.yml
└── LICENSE
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "wwwroot/lib"
3 | }
4 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Write your JavaScript code.
2 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/core/README.md:
--------------------------------------------------------------------------------
1 | ## [AspectCore中的IoC容器和依赖注入](https://github.com/dotnetcore/AspectCore-Framework/blob/master/docs/injector.md)
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Manage/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using AspNetCore.Sample.Views.Manage
2 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.Autofac.WebSample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.DependencyInjection.Sample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AspectCore/AspectCore-Framework/HEAD/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/reflection/src/AspectCore.Extensions.Reflection/CallOptions.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Extensions.Reflection
2 | {
3 | public enum CallOptions
4 | {
5 | Call,
6 | Callvirt
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Configuration/AspectPredicate.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace AspectCore.Configuration
4 | {
5 | public delegate bool AspectPredicate(MethodInfo method);
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/AspectDelegate.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | public delegate Task AspectDelegate(AspectContext context);
6 | }
7 |
--------------------------------------------------------------------------------
/aspectscope/src/AspectCore.Extensions.AspectScope/Scope.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Extensions.AspectScope
2 | {
3 | public enum Scope
4 | {
5 | None,
6 |
7 | Nested,
8 |
9 | Aspect
10 | }
11 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Account/SignedOut.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Signed out";
3 | }
4 |
5 |
@ViewData["Title"]
6 |
7 | You have successfully signed out.
8 |
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/AspectValidationDelegate.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | public delegate bool AspectValidationDelegate(AspectValidationContext context);
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectActivatorFactory.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.DynamicProxy
2 | {
3 | [NonAspect]
4 | public interface IAspectActivatorFactory
5 | {
6 | IAspectActivator Create();
7 | }
8 | }
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/SkipValidationAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.Extensions.DataValidation
4 | {
5 | public class SkipValidationAttribute : Attribute
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectValidatorBuilder.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.DynamicProxy
2 | {
3 | [NonAspect]
4 | public interface IAspectValidatorBuilder
5 | {
6 | IAspectValidator Build();
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 | @ViewData["Title"]
5 | @ViewData["Message"]
6 |
7 | Use this area to provide additional information.
8 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectBuilderFactory.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.DynamicProxy
2 | {
3 | [NonAspect]
4 | public interface IAspectBuilderFactory
5 | {
6 | IAspectBuilder Create(AspectContext context);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/reflection/src/AspectCore.Extensions.Reflection/IParameterReflectorProvider.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Extensions.Reflection
2 | {
3 | public interface IParameterReflectorProvider
4 | {
5 | ParameterReflector[] ParameterReflectors { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/Parameters/ParameterAspectDelegate.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace AspectCore.DynamicProxy.Parameters
4 | {
5 | public delegate Task ParameterAspectDelegate(ParameterAspectContext context);
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/IScopeResolverFactory.cs:
--------------------------------------------------------------------------------
1 | using AspectCore.DynamicProxy;
2 |
3 | namespace AspectCore.Injector
4 | {
5 | [NonAspect]
6 | public interface IScopeResolverFactory
7 | {
8 | IServiceResolver CreateScope();
9 | }
10 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Confirm email";
3 | }
4 |
5 | @ViewData["Title"]
6 |
7 |
8 | Thank you for confirming your email.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Account/ForgotPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Forgot password confirmation";
3 | }
4 |
5 | @ViewData["Title"]
6 |
7 | Please check your email to reset your password.
8 |
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/IPropertyInjector.cs:
--------------------------------------------------------------------------------
1 | using AspectCore.DynamicProxy;
2 |
3 | namespace AspectCore.Injector
4 | {
5 | [NonAspect]
6 | public interface IPropertyInjector
7 | {
8 | void Invoke(object implementation);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/DataValidationState.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Extensions.DataValidation
2 | {
3 | public enum DataValidationState
4 | {
5 | Unvalidated,
6 | Invalid,
7 | Valid,
8 | Skipped
9 | }
10 | }
--------------------------------------------------------------------------------
/reflection/src/AspectCore.Extensions.Reflection/ICustomAttributeReflectorProvider.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Extensions.Reflection
2 | {
3 | public interface ICustomAttributeReflectorProvider
4 | {
5 | CustomAttributeReflector[] CustomAttributeReflectors { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.Autofac.WebSample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/AsyncAspectAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
6 | public class AsyncAspectAttribute : Attribute
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/ITransientServiceAccessor.cs:
--------------------------------------------------------------------------------
1 | using AspectCore.DynamicProxy;
2 |
3 | namespace AspectCore.Injector
4 | {
5 | [NonAspect]
6 | public interface ITransientServiceAccessor where T : class
7 | {
8 | T Value { get; }
9 | }
10 | }
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Windsor.Test/Fakes/IController.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Extensions.Windsor.Test.Fakes
2 | {
3 | [CacheInterceptor]
4 | public interface IController
5 | {
6 | ICacheService Service { get; }
7 | Model Execute();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/reflection/README.md:
--------------------------------------------------------------------------------
1 | 在从零实现AOP的过程中,难免会需要大量反射相关的操作,虽然在.net 4.5+/.net core中反射的性能有了大幅的优化,但为了追求极致性能,自己实现了部分反射的替代方案,包括构造器调用、方法调用、字段读写,属性读写和特性读取。在重构时,把反射扩展操作封装到单独的项目中,以此方便自己和大家使用。[获取AspectCore.Extension.Reflection](https://github.com/dotnetcore/AspectCore-Framework/blob/master/docs/reflection-extensions.md)
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectValidator.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [NonAspect]
6 | public interface IAspectValidator
7 | {
8 | bool Validate(MethodInfo method, bool isStrictValidation);
9 | }
10 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Account/AccessDenied.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Access denied";
3 | }
4 |
5 |
9 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AspectCore/AspectCore-Framework/HEAD/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AspectCore/AspectCore-Framework/HEAD/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AspectCore/AspectCore-Framework/HEAD/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.DependencyInjection.Sample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/aspectscope/src/AspectCore.Extensions.AspectScope/IScopeInterceptor.cs:
--------------------------------------------------------------------------------
1 | using AspectCore.DynamicProxy;
2 |
3 | namespace AspectCore.Extensions.AspectScope
4 | {
5 | [NonAspect]
6 | public interface IScopeInterceptor : IInterceptor
7 | {
8 | Scope Scope { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectCachingProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [NonAspect]
6 | public interface IAspectCachingProvider : IDisposable
7 | {
8 | IAspectCaching GetAspectCaching(string name);
9 | }
10 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/NonAspectAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
6 | public class NonAspectAttribute : Attribute
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asp.net",
3 | "private": true,
4 | "dependencies": {
5 | "bootstrap": "3.3.7",
6 | "jquery": "2.2.0",
7 | "jquery-validation": "1.14.0",
8 | "jquery-validation-unobtrusive": "3.2.6"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AspectCore/AspectCore-Framework/HEAD/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Account/Lockout.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Locked out";
3 | }
4 |
5 |
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/Parameters/IParameterInterceptorSelector.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace AspectCore.DynamicProxy.Parameters
4 | {
5 | public interface IParameterInterceptorSelector
6 | {
7 | IParameterInterceptor[] Select(ParameterInfo parameter);
8 | }
9 | }
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/IDataValidator.cs:
--------------------------------------------------------------------------------
1 | using AspectCore.DynamicProxy;
2 |
3 | namespace AspectCore.Extensions.DataValidation
4 | {
5 | [NonAspect]
6 | public interface IDataValidator
7 | {
8 | void Validate(DataValidationContext context);
9 | }
10 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/Account/ResetPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Reset password confirmation";
3 | }
4 |
5 | @ViewData["Title"]
6 |
7 | Your password has been reset. Please click here to log in.
8 |
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/DynamicallyAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
6 | public sealed class DynamicallyAttribute : Attribute
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/core/test/AspectCore.Abstractions.Test/Fakes/ProxyService.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Abstractions.Internal.Test.Fakes
2 | {
3 | public class ProxyService : TargetService
4 | {
5 | public override int Add(int value)
6 | {
7 | return base.Add(value);
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/IPropertyInjectorFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AspectCore.DynamicProxy;
3 |
4 | namespace AspectCore.Injector
5 | {
6 | [NonAspect]
7 | public interface IPropertyInjectorFactory
8 | {
9 | IPropertyInjector Create(Type implementationType);
10 | }
11 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/IServiceResolver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AspectCore.DynamicProxy;
3 |
4 | namespace AspectCore.Injector
5 | {
6 | [NonAspect]
7 | public interface IServiceResolver : IServiceProvider, IDisposable
8 | {
9 | object Resolve(Type serviceType);
10 | }
11 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/IManyEnumerable.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using AspectCore.DynamicProxy;
4 |
5 | namespace AspectCore.Injector
6 | {
7 | [NonAspect]
8 | public interface IManyEnumerable : IEnumerable, IEnumerable
9 | {
10 | }
11 | }
--------------------------------------------------------------------------------
/core/performance/AspectCore.Benchmark/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BenchmarkDotNet.Running;
3 |
4 | namespace AspectCore.Benchmark
5 | {
6 | class Program
7 | {
8 | static void Main(string[] args)
9 | {
10 | //BenchmarkRunner.Run();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Windsor.Test/Fakes/Model.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace AspectCore.Extensions.Windsor.Test.Fakes
5 | {
6 | public class Model
7 | {
8 | public int Id { get; set; }
9 |
10 | public Guid Version { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IInterceptorSelector.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Reflection;
3 |
4 | namespace AspectCore.DynamicProxy
5 | {
6 | [NonAspect]
7 | public interface IInterceptorSelector
8 | {
9 | IEnumerable Select(MethodInfo method);
10 | }
11 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Models/ErrorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspNetCore.Sample.Models
4 | {
5 | public class ErrorViewModel
6 | {
7 | public string RequestId { get; set; }
8 |
9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
10 | }
11 | }
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/IDataStateFactory.cs:
--------------------------------------------------------------------------------
1 | using AspectCore.DynamicProxy;
2 |
3 | namespace AspectCore.Extensions.DataValidation
4 | {
5 | [NonAspect]
6 | public interface IDataStateFactory
7 | {
8 | IDataState CreateDataState(DataValidationContext dataValidationContext);
9 | }
10 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Identity
2 | @using AspNetCore.Sample
3 | @using AspNetCore.Sample.Models
4 | @using AspNetCore.Sample.Models.AccountViewModels
5 | @using AspNetCore.Sample.Models.ManageViewModels
6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
7 |
--------------------------------------------------------------------------------
/core/performance/AspectCore.IoC.Benchmarks/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BenchmarkDotNet.Running;
3 |
4 | namespace AspectCore.IoC.Benchmarks
5 | {
6 | class Program
7 | {
8 | static void Main(string[] args)
9 | {
10 | BenchmarkRunner.Run();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/core/test/AspectCore.Abstractions.Test/Fakes/IValidatorModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace AspectCore.Abstractions.Internal.Test.Fakes
7 | {
8 | public interface IValidatorModel
9 | {
10 | void Validate();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/Parameters/IParameterInterceptor.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace AspectCore.DynamicProxy.Parameters
4 | {
5 | [NonAspect]
6 | public interface IParameterInterceptor
7 | {
8 | Task Invoke(ParameterAspectContext context, ParameterAspectDelegate next);
9 | }
10 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Autofac.Test/Fakes/Service.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.Extensions.Test.Fakes
4 | {
5 | public class Service : IService
6 | {
7 | public virtual Model Get(int id)
8 | {
9 | return new Model { Id = id, Version = Guid.NewGuid() };
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectContextFactory.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.DynamicProxy
2 | {
3 | [NonAspect]
4 | public interface IAspectContextFactory
5 | {
6 | AspectContext CreateContext(AspectActivatorContext activatorContext);
7 |
8 | void ReleaseContext(AspectContext aspectContext);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Autofac.Test/Fakes/IService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace AspectCore.Extensions.Test.Fakes
7 | {
8 | public interface IService
9 | {
10 | [CacheInterceptor]
11 | Model Get(int id);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/Injector/FromContainerAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.Injector
4 | {
5 | [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
6 | public class FromContainerAttribute : Attribute
7 | {
8 | public FromContainerAttribute()
9 | {
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectValidationHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [NonAspect]
6 | public interface IAspectValidationHandler
7 | {
8 | int Order { get; }
9 |
10 | bool Invoke(AspectValidationContext context, AspectValidationDelegate next);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Windsor.Test/Fakes/ICacheService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace AspectCore.Extensions.Windsor.Test.Fakes
4 | {
5 | public interface ICacheService
6 | {
7 | [CacheInterceptor]
8 | Model Get(int id);
9 |
10 | [CacheInterceptor]
11 | Task GetAsync(int id);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace AspectCore.DynamicProxy
5 | {
6 | [NonAspect]
7 | public interface IAspectBuilder
8 | {
9 | IEnumerable> Delegates { get; }
10 |
11 | AspectDelegate Build();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Autofac.Test/Fakes/Model.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace AspectCore.Extensions.Test.Fakes
7 | {
8 | public class Model
9 | {
10 | public int Id { get; set; }
11 |
12 | public Guid Version { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IInterceptorCollector.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Reflection;
3 |
4 | namespace AspectCore.DynamicProxy
5 | {
6 | [NonAspect]
7 | public interface IInterceptorCollector
8 | {
9 | IEnumerable Collect(MethodInfo serviceMethod, MethodInfo implementationMethod);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/IDataStateProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using AspectCore.DynamicProxy;
5 |
6 | namespace AspectCore.Extensions.DataValidation
7 | {
8 | [NonAspect]
9 | public interface IDataStateProvider
10 | {
11 | IDataState DataState { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Services/IBookService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using AspNetCore.Sample.Models;
6 |
7 | namespace AspNetCore.Sample.Services
8 | {
9 | public interface IBookService
10 | {
11 | void Create(CreateBookDto dto);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/Services/IEmailSender.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace AspNetCore.Sample.Services
7 | {
8 | public interface IEmailSender
9 | {
10 | Task SendEmailAsync(string email, string subject, string message);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/extras/src/AspectCore.Extensions.AspNetCore/Http/ExecutionContextHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading;
5 |
6 | namespace AspectCore.Extensions.AspNetCore.Http
7 | {
8 | public static class ExecutionContextHelper
9 | {
10 | public static ExecutionContext Current { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Core/Utils/ArrayUtils.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Utils
2 | {
3 | internal static class ArrayUtils
4 | {
5 | public static T[] Empty()
6 | {
7 | return EmptyArray.Value;
8 | }
9 |
10 | private static class EmptyArray
11 | {
12 | public static readonly T[] Value = new T[0];
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/core/test/AspectCore.Abstractions.Test/Fakes/ITargetService.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.Abstractions.Internal.Test.Fakes
2 | {
3 | public interface ITargetService
4 | {
5 | [Increment]
6 | int Add(int value);
7 | }
8 |
9 | [Increment]
10 | public interface ITargetService
11 | {
12 |
13 | [Increment]
14 | T Add(T value);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/extras/test/AspectCore.Extensions.Autofac.Test/Fakes/IController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace AspectCore.Extensions.Test.Fakes
7 | {
8 | [CacheInterceptor]
9 | public interface IController
10 | {
11 | IService Service { get; }
12 | Model Execute();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/IPropertyValidator.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using AspectCore.DynamicProxy;
3 |
4 | namespace AspectCore.Extensions.DataValidation
5 | {
6 | [NonAspect]
7 | public interface IPropertyValidator
8 | {
9 | IEnumerable Validate(PropertyValidationContext propertyValidationContext);
10 | }
11 | }
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IServiceInstanceAccessor.cs:
--------------------------------------------------------------------------------
1 | namespace AspectCore.DynamicProxy
2 | {
3 | [NonAspect]
4 | public interface IServiceInstanceAccessor
5 | {
6 | object ServiceInstance { get; }
7 | }
8 |
9 | [NonAspect]
10 | public interface IServiceInstanceAccessor
11 | {
12 | TService ServiceInstance { get; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Core/Utils/TaskUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace AspectCore.Utils
4 | {
5 | internal static class TaskUtils
6 | {
7 | internal static readonly Task CompletedTask = Task.FromResult(false);
8 | }
9 |
10 | internal static class TaskUtils
11 | {
12 | internal static readonly Task CompletedTask = Task.FromResult(default(T));
13 | }
14 | }
--------------------------------------------------------------------------------
/datavalidation/src/AspectCore.Extensions.DataValidation/IDataState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using AspectCore.DynamicProxy;
5 |
6 | namespace AspectCore.Extensions.DataValidation
7 | {
8 | [NonAspect]
9 | public interface IDataState
10 | {
11 | bool IsValid { get; }
12 |
13 | DataValidationErrorCollection Errors { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/extras/sample/AspectCore.Extensions.AspNetCore.Sample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-AspNetCore.Sample-801AA809-9522-45D6-B05D-BA4E539F156C;Trusted_Connection=True;MultipleActiveResultSets=true"
4 | },
5 | "Logging": {
6 | "IncludeScopes": false,
7 | "LogLevel": {
8 | "Default": "Warning"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IInterceptor.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [NonAspect]
6 | public interface IInterceptor
7 | {
8 | bool AllowMultiple { get; }
9 |
10 | bool Inherited { get; set; }
11 |
12 | int Order { get; set; }
13 |
14 | Task Invoke(AspectContext context, AspectDelegate next);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/core/src/AspectCore.Abstractions/DynamicProxy/IAspectCaching.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AspectCore.DynamicProxy
4 | {
5 | [NonAspect]
6 | public interface IAspectCaching : IDisposable
7 | {
8 | string Name { get; }
9 |
10 | object Get(object key);
11 |
12 | void Set(object key, object value);
13 |
14 | object GetOrAdd(object key, Func