Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

BeyondNet.Aop

A high-performance Aspect-Oriented Programming (AOP) framework for .NET

English | Español

NuGetBuild


Welcome to BeyondNet.Aop! This framework allows you to implement cross-cutting concerns (such as logging, retries, caching, etc.) cleanly and efficiently using .NET's native DispatchProxy, augmented with high-performance caching for reflection and dynamic compilation.

Installation

NuGet Packages

# Core AOP library
dotnet add package BeyondNetCode.Shell.Aop
# Pre-built aspects (retry, logging, etc.)
dotnet add package BeyondNetCode.Shell.Aop.Aspects
# Serilog integration (recommended for observability)
dotnet add package BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog
# Dependency Injection installer
dotnet add package BeyondNetCode.Shell.Aop.DI

Packages Overview

PackageDescriptionNuGet
BeyondNetCode.Shell.AopCore AOP abstractions and executorlink
BeyondNetCode.Shell.Aop.AspectsPre-built retry, logger, and advice aspectslink
BeyondNetCode.Shell.Aop.Aspects.LoggerCommon.Logging integrationlink
BeyondNetCode.Shell.Aop.Aspects.Logger.SerilogSerilog integration with structured logginglink
BeyondNetCode.Shell.Aop.DispatchProxyNative DispatchProxy-based proxy creationlink
BeyondNetCode.Shell.Aop.DIMicrosoft.Extensions.DependencyInjection extensionslink

Quick Start

// 1. Define your aspect attribute[AttributeUsage(AttributeTargets.Method)]publicclassRetryAttribute:AbstractAspectAttribute{publicintMaxRetries{get;set;}=3;publicintDelayMs{get;set;}=1000;}// 2. Implement your aspectpublicclassRetryAspect:OnMethodBoundaryAspect<RetryAttribute>{protectedoverridevoidOnEntry(IJoinPointjoinPoint){Console.WriteLine($"Entering {joinPoint.MethodInfo.Name}");}protectedoverridevoidOnException(IJoinPointjoinPoint,Exceptionex){// Implement retry logic}}// 3. Apply to your interfacepublicinterfaceIMyService{[Retry(MaxRetries=3)]Task<string>DoSomethingAsync();}// 4. Register in DIservices.AddAopAspects(typeof(IMyService).Assembly);

Documentation

For detailed documentation, see the language-specific README files:

Migration from Ums.Shell.Aop

If you were using Ums.Shell.Aop, update your NuGet references:

# Before (Ums.Shell.Aop)
dotnet add package Ums.Shell.Aop
# After (BeyondNetCode.Shell.Aop)
dotnet add package BeyondNetCode.Shell.Aop

Update namespaces in your code:

// BeforeusingUms.Shell.Aop;// AfterusingBeyondNetCode.Shell.Aop;

Contributing

See CONTRIBUTING.md for GitFlow workflow, commit conventions, and coding standards.

Versioning

See VERSIONING.md for SemVer strategy and release process.

License

Licensed under the Apache 2.0 License. See LICENSE for details.

Acknowledgments

See DISCLAIMER.md for original code authorship attribution.

About

High-performance AOP framework for .NET using DispatchProxy, with support for logging, retries, caching, DI, and reusable aspects.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages