{"id":23170982,"url":"https://github.com/ignatandrei/rscg_decorator","last_synced_at":"2025-08-04T07:11:03.305Z","repository":{"id":197452894,"uuid":"698690864","full_name":"ignatandrei/RSCG_Decorator","owner":"ignatandrei","description":"Decorator for classes , permit to know when method start and ends","archived":false,"fork":false,"pushed_at":"2024-01-06T22:30:44.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T01:18:59.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ignatandrei.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-30T17:03:30.000Z","updated_at":"2024-01-12T09:22:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"838d7552-9d37-45b3-a588-69d80ea8c0af","html_url":"https://github.com/ignatandrei/RSCG_Decorator","commit_stats":null,"previous_names":["ignatandrei/rscg_decorator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ignatandrei/RSCG_Decorator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Decorator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Decorator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Decorator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Decorator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ignatandrei","download_url":"https://codeload.github.com/ignatandrei/RSCG_Decorator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ignatandrei%2FRSCG_Decorator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268157283,"owners_count":24204744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":[],"created_at":"2024-12-18T04:15:47.910Z","updated_at":"2025-08-04T07:11:03.262Z","avatar_url":"https://github.com/ignatandrei.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSCG_Decorator\nDecorator for classes , permit to know when method start and ends\n\n\n## Usage\n\nAdd reference to RSCG_Decorator and RSCG_DecoratorCommon\n\n```xml\n\u003cItemGroup\u003e\n\t\n\t  \u003cPackageReference Include=\"RSCG_Decorator\" Version=\"7.2023.930.2116\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"false\"  /\u003e\n\t  \u003cPackageReference Include=\"RSCG_DecoratorCommon\" Version=\"7.2023.930.2116\" /\u003e\n\u003c/ItemGroup\u003e\n\u003cPropertyGroup\u003e\n\t\u003cEmitCompilerGeneratedFiles\u003etrue\u003c/EmitCompilerGeneratedFiles\u003e\n\t\u003cCompilerGeneratedFilesOutputPath\u003e$(BaseIntermediateOutputPath)\\GX\u003c/CompilerGeneratedFilesOutputPath\u003e\n\u003c/PropertyGroup\u003e\n\t\n```\n\nFor any class that you want to intercept methods, implement interface IDecoratorMethodV1\n\nSee example at the RSCG_DecoratorTestConsole\n\n```csharp\npublic partial class Person : IDecoratorMethodV1\n{\n    public void EndMethod(MethodRecognizer recognizer)\n    {\n        logger.LogInformation(\"end \"+recognizer.UniqueId);\n    }\n\n   \n    public void ExceptionMethod(Exception ex, MethodRecognizer recognizer)\n    {\n        logger.LogError(ex, \"exception on \" + recognizer.UniqueId+ \" Value Parameters:\" + recognizer.ValueTypeParametersString); \n    }\n\n\n    public void StartMethod(MethodRecognizer recognizer)\n    {\n        logger.LogInformation(\"start \" + recognizer.UniqueId + \" Value Parameters:\"+recognizer.ValueTypeParametersString);\n   }\n}\n```\n\n## Usage with ASP.NET Core - or any DI framework\n\nLet's take Person with interface IPerson. You have the following:\n\n```csharp\nserviceCollection \n          .AddTransient\u003cIPerson, Person\u003e();\n\n```\nYou can add this as the latest\n\n```csharp\nserviceCollection = serviceCollection\n     .AddTransient\u003cPerson, Person\u003e()\n     .AddTransient\u003cIPerson, Person_Decorator\u003e();\n     \n```\n\nAnd when asking for IPerson , the last wins:\n\n```csharp\n\nvar data = serviceProvider.GetRequiredService\u003cIPerson\u003e();\n//obtaining Person_Decorator because is the last one\n\n```\n# More Roslyn Source Code Generators\n\nYou can find more RSCG with examples at [Roslyn Source Code Generators](https://ignatandrei.github.io/RSCG_Examples/v2/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignatandrei%2Frscg_decorator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignatandrei%2Frscg_decorator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignatandrei%2Frscg_decorator/lists"}