Skip to content

beyondnetcode/Shell.Aop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeyondNet.Aop

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

🇬🇧 English | 🇪🇸 Español

NuGet Build


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

Package Description NuGet
BeyondNetCode.Shell.Aop Core AOP abstractions and executor link
BeyondNetCode.Shell.Aop.Aspects Pre-built retry, logger, and advice aspects link
BeyondNetCode.Shell.Aop.Aspects.Logger Common.Logging integration link
BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog Serilog integration with structured logging link
BeyondNetCode.Shell.Aop.DispatchProxy Native DispatchProxy-based proxy creation link
BeyondNetCode.Shell.Aop.DI Microsoft.Extensions.DependencyInjection extensions link

Quick Start

// 1. Define your aspect attribute
[AttributeUsage(AttributeTargets.Method)]
public class RetryAttribute : AbstractAspectAttribute
{
    public int MaxRetries { get; set; } = 3;
    public int DelayMs { get; set; } = 1000;
}

// 2. Implement your aspect
public class RetryAspect : OnMethodBoundaryAspect<RetryAttribute>
{
    protected override void OnEntry(IJoinPoint joinPoint)
    {
        Console.WriteLine($"Entering {joinPoint.MethodInfo.Name}");
    }

    protected override void OnException(IJoinPoint joinPoint, Exception ex)
    {
        // Implement retry logic
    }
}

// 3. Apply to your interface
public interface IMyService
{
    [Retry(MaxRetries = 3)]
    Task<string> DoSomethingAsync();
}

// 4. Register in DI
services.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:

// Before
using Ums.Shell.Aop;

// After
using BeyondNetCode.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

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages