{"id":50882353,"url":"https://github.com/beyondnetcode/shell.aop","last_synced_at":"2026-06-15T14:01:36.810Z","repository":{"id":363164615,"uuid":"1254303018","full_name":"beyondnetcode/Shell.Aop","owner":"beyondnetcode","description":"High-performance AOP framework for .NET using DispatchProxy, with support for logging, retries, caching, DI, and reusable aspects.","archived":false,"fork":false,"pushed_at":"2026-06-07T17:08:08.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T19:08:24.935Z","etag":null,"topics":["aop","aop-aspects","csharp","dispatchproxy","net"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beyondnetcode.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T11:55:43.000Z","updated_at":"2026-06-07T17:08:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/beyondnetcode/Shell.Aop","commit_stats":null,"previous_names":["beyondnetcode/shell.aop"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/beyondnetcode/Shell.Aop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondnetcode%2FShell.Aop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondnetcode%2FShell.Aop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondnetcode%2FShell.Aop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondnetcode%2FShell.Aop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyondnetcode","download_url":"https://codeload.github.com/beyondnetcode/Shell.Aop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondnetcode%2FShell.Aop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34365597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aop","aop-aspects","csharp","dispatchproxy","net"],"created_at":"2026-06-15T14:01:33.853Z","updated_at":"2026-06-15T14:01:36.808Z","avatar_url":"https://github.com/beyondnetcode.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BeyondNet.Aop\n\n\u003cp\u003e\n  \u003cstrong\u003eEnglish\u003c/strong\u003e | \u003ca href=\"README.es.md\"\u003eEspañol\u003c/a\u003e\n\u003c/p\u003e\n\nBeyondNet.Aop is a high-performance Aspect-Oriented Programming (AOP) framework for .NET 10. It allows you to cleanly separate cross-cutting concerns (like logging, error handling, retries, etc.) from your core business logic using native `.NET` `DispatchProxy` with heavy caching optimizations.\n\n## Features\n\n- **High Performance**: Uses `ConcurrentDictionary` to cache reflection calls and dynamic expression compilation (O(1) lookups).\n- **Clean Code**: Strict naming conventions and semantic exceptions.\n- **Native .NET**: Built on top of `System.Reflection.DispatchProxy` without requiring complex post-compilation weaving tools.\n- **Extensible**: Easily plug in custom loggers or evaluation engines.\n- **Observability**: Built-in Serilog integration with structured logging and execution context propagation.\n- **DI Integration**: Seamless integration with Microsoft.Extensions.DependencyInjection.\n\n## Architecture\n\nThe framework is organized into modular packages:\n\n```\nBeyondNetCode.Shell.Aop              # Core abstractions (IAspect, IJoinPoint, AspectExecutor)\nBeyondNetCode.Shell.Aop.Aspects      # Pre-built aspects (Retry, Logger, Advice)\nBeyondNetCode.Shell.Aop.DispatchProxy # Proxy creation using DispatchProxy\nBeyondNetCode.Shell.Aop.Aspects.Logger # Common.Logging integration\nBeyondNetCode.Shell.Aop.Aspects.Logger.Serilog # Serilog integration with structured logging\nBeyondNetCode.Shell.Aop.DI           # Dependency Injection extensions\n```\n\n## Installation\n\n```bash\n# Core library\ndotnet add package BeyondNetCode.Shell.Aop\n\n# Pre-built aspects\ndotnet add package BeyondNetCode.Shell.Aop.Aspects\n\n# Serilog integration (recommended)\ndotnet add package BeyondNetCode.Shell.Aop.Aspects.Logger.Serilog\n\n# DI installer\ndotnet add package BeyondNetCode.Shell.Aop.DI\n```\n\n## Quick Start\n\n### Step 1: Define an Aspect Attribute\n\n```csharp\n[AttributeUsage(AttributeTargets.Method)]\npublic class MyLogAttribute : AbstractAspectAttribute\n{\n    public string Message { get; set; }\n}\n```\n\n### Step 2: Implement the Aspect\n\n```csharp\npublic class MyLogAspect : OnMethodBoundaryAspect\u003cMyLogAttribute\u003e\n{\n    protected override void OnEntry(IJoinPoint joinPoint)\n    {\n        var attr = GetAttribute(joinPoint);\n        Console.WriteLine($\"Method {joinPoint.MethodInfo.Name}: {attr.Message}\");\n    }\n}\n```\n\n### Step 3: Apply to Interface Methods\n\n```csharp\npublic interface IMyService\n{\n    [MyLog(Message = \"Starting operation\")]\n    Task\u003cResult\u003e DoWorkAsync();\n}\n```\n\n### Step 4: Register in DI\n\n```csharp\nservices.AddAopAspects(typeof(IMyService).Assembly);\n```\n\n## Advanced Topics\n\n### Custom Pointcuts\n\nImplement `IPointCut` to control when aspects are applied:\n\n```csharp\npublic class MyPointCut : IPointCut\n{\n    public bool CanApply(IJoinPoint joinPoint, Type aspectType)\n    {\n        // Custom logic\n    }\n}\n```\n\n### Aspect Ordering\n\nUse the `Order` property on attributes to control execution order:\n\n```csharp\n[MyAspect(Order = 1)]\n[AnotherAspect(Order = 2)]\nvoid MyMethod() { }\n```\n\n### Retry with Exponential Backoff\n\n```csharp\npublic class RetryAttribute : AbstractAspectAttribute\n{\n    public int MaxRetries { get; set; } = 3;\n    public int BaseDelayMs { get; set; } = 1000;\n}\n\npublic class RetryAspect : OnRetryAspect\u003cRetryAttribute\u003e\n{\n    protected override bool CanRetry(IJoinPoint joinPoint, Exception ex)\n    {\n        return GetAttribute(joinPoint) is { } attr \u0026\u0026\n               attr.MaxRetries \u003e 0;\n    }\n}\n```\n\n## Testing\n\n```bash\ndotnet test\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for GitFlow workflow and coding standards.\n\n## Versioning\n\nSee [VERSIONING.md](VERSIONING.md) for SemVer strategy.\n\n## License\n\nApache 2.0 - See [LICENSE](LICENSE)\n\n## Acknowledgments\n\nSee [DISCLAIMER.md](DISCLAIMER.md) for original code authorship.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondnetcode%2Fshell.aop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyondnetcode%2Fshell.aop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondnetcode%2Fshell.aop/lists"}