{"id":37053379,"url":"https://github.com/f135ta/simpleproxy","last_synced_at":"2026-01-14T06:01:11.417Z","repository":{"id":49614768,"uuid":"169867919","full_name":"f135ta/SimpleProxy","owner":"f135ta","description":"Simple Proxy implementation for Net Core using Castle Dynamic Proxy","archived":false,"fork":false,"pushed_at":"2021-06-28T11:51:59.000Z","size":64,"stargazers_count":53,"open_issues_count":7,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-25T12:10:04.305Z","etag":null,"topics":["castle-core","csharp","dynamic-proxy","microsoft-extensions","netcore","netcore22","proxy"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f135ta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-09T13:07:06.000Z","updated_at":"2024-05-05T07:11:19.000Z","dependencies_parsed_at":"2022-08-25T23:11:40.311Z","dependency_job_id":null,"html_url":"https://github.com/f135ta/SimpleProxy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/f135ta/SimpleProxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f135ta%2FSimpleProxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f135ta%2FSimpleProxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f135ta%2FSimpleProxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f135ta%2FSimpleProxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f135ta","download_url":"https://codeload.github.com/f135ta/SimpleProxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f135ta%2FSimpleProxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["castle-core","csharp","dynamic-proxy","microsoft-extensions","netcore","netcore22","proxy"],"created_at":"2026-01-14T06:01:10.289Z","updated_at":"2026-01-14T06:01:11.407Z","avatar_url":"https://github.com/f135ta.png","language":"C#","readme":"\u003cimg src=\"https://mydrivestore.blob.core.windows.net/logos/ProxyLogo.png\" alt=\"SimpleProxy\"\u003e\n\n## What is SimpleProxy?\n\nSimpleProxy solves the problem of Aspect Orientated Programming (AoP) in Net Core. It builds on the current Net Core Dependency Injection functions to extend it, providing Proxy services with a very small learning curve.\n\n## What is Aspect Orientated Programming?\n\nWikipedia describes AOP as the following: \n\n\"In computing, _aspect-oriented programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns_. It does so by adding additional behavior to existing code (an advice) without modifying the code itself...\"\n\nSource: https://en.wikipedia.org/wiki/Aspect-oriented_programming\n\n## SimpleProxy vs PostSharp\nPostSharp is a long established and mature solution for doing what SimpleProxy does. It allows you to add additional functionality to your classes without spoiling them with repetitive boilerplater code. The fundamental difference is that PostSharp injects its code AFTER compilation, changing the the binaries that are output with additional code. SimpleProxy will wrap your code at runtime, so debugging is easy, and the changes more transparent to a developer. In short, SimpleProxy makes things more obvious.\n\n## Getting Started\n\n##### Option 1 =\u003e Source Code\n- Download the code from GitHub, either by cloning the repository or downloading the files directly.\n- Open the [SimpleProxy.sln] file in Visual Studio\n- Build the solution\n- Start the [SampleApp] project to see it in action\n\n##### Option 2 =\u003e Binary\nVisit https://www.nuget.org/packages/SimpleProxy/1.0.1 and download the latest binary\n\n##### Option 3 =\u003e Nuget\nInstall directly into your project using: ```Install-Package SimpleProxy -Version 1.0.1``` in your Nuget Package Manager\n\n#### What do I need to run the code?\n\n- Visual Studio 2017 or later\n- Net Core 2.2 SDK installed =\u003e https://dotnet.microsoft.com/download/dotnet-core/2.2 (Official Download)\n\n#### How does it work?\n\nCreating proxies for objects is **not** straightforward. One of the most common frameworks for doing so is (and has been for a long time) Castle Core. (https://github.com/castleproject/Core). Infact, Castle Core is used as a fundamental building block for this project. Documentation can be difficult to find for Castle Core and its not straightforward to work with on its own.\n\nSimpleProxy is designed to simplify the whole process. Interception is done in just a few steps:\n\n- Create a custom attribute that derives from the SimpleProxy base attribute\n\n```\npublic class MyCustomAttribute : MethodInterceptionAttribute\n{\n    public MyCustomAttribute()\n    {\n    }\n}\n```\n\n- Create an interceptor that implements the SimpleProxy IMethodInterceptor\n\n```\npublic class MyCustomInterceptor : IMethodInterceptor\n{\n    public void BeforeInvoke(InvocationContext invocationContext)\n    {\n    }\n\n    public void AfterInvoke(InvocationContext invocationContext, object methodResult)\n    {\n    }\n}\n```\n    \n- Register a mapping for the Attribute \u0026 Interceptors in the ServiceCollection\n\n```\n    // Configure the Service Provider\n    var services = new ServiceCollection();\n\n    // Enable SimpleProxy\n    services.EnableSimpleProxy(p =\u003e p.AddInterceptor\u003cMyCustomAttribute, MyCustomInterceptor\u003e());\n``` \n\n- Add your class to the ServiceCollection using one of the SimpleProxy IServiceCollection overloads\n\n```\n    services.AddTransientWithProxy\u003cITestClass, TestClass\u003e();\n```    \n\nSimpleProxy uses the default Microsoft.Extensions.DependencyInjection library built into ASP Net Core to register interceptors and then intercept method calls based on the attributes applied to your methods. Methods are intercepted with YOUR own code either before and/or after a method call.\n\n#### How do I register interceptors with the DI Framework?\n\nInterceptors are registered in the Microsoft DI framework using the EnableSimpleProxy extension method on IServiceCollection. The ```AddInterceptor\u003cT,T2\u003e()``` method uses the fluent interface so it can be chained for easier configuration.\n\n```\n    // Configure the Service Provider\n    var services = new ServiceCollection();\n\n    // Enable SimpleProxy\n    services.EnableSimpleProxy(p =\u003e p\n            .AddInterceptor\u003cMyCustomAttribute, MyCustomInterceptor\u003e()\n            .AddInterceptor\u003cMyCustomAttribute2, MyCustomInterceptor2\u003e());\n```\n\n#### What is InvocationContext?\n...\n\n#### How do I intercept my method calls?\n...\n\n#### Can I change the method values?\n...\n\n#### How do I get the return value from the method that was invoked?\n...\n\n#### Are there any example interceptors to get started with?\n...\n\n#### How can I extend SimpleProxy?\n...\n\n#### Is SimpleProxy actively developed?\n...\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff135ta%2Fsimpleproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff135ta%2Fsimpleproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff135ta%2Fsimpleproxy/lists"}