{"id":19992590,"url":"https://github.com/ArxOne/MrAdvice","last_synced_at":"2025-05-04T11:31:32.478Z","repository":{"id":26661008,"uuid":"30117370","full_name":"ArxOne/MrAdvice","owner":"ArxOne","description":".NET aspect weaver (build task under NuGet package)","archived":false,"fork":false,"pushed_at":"2025-02-20T09:44:23.000Z","size":7617,"stargazers_count":318,"open_issues_count":18,"forks_count":47,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-14T04:58:34.449Z","etag":null,"topics":["advice","aop","aspects","assembly","inject-aspects"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mjhea0/hibbert-django","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArxOne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-01-31T16:06:34.000Z","updated_at":"2025-04-09T21:17:42.000Z","dependencies_parsed_at":"2024-01-08T15:54:01.869Z","dependency_job_id":"9444d60e-69e5-449e-98e2-5c02254d930f","html_url":"https://github.com/ArxOne/MrAdvice","commit_stats":{"total_commits":723,"total_committers":9,"mean_commits":80.33333333333333,"dds":"0.051175656984785656","last_synced_commit":"4b9a1a83623746f912eee76b92b54518630b6430"},"previous_names":["arxone/weavisor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArxOne%2FMrAdvice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArxOne%2FMrAdvice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArxOne%2FMrAdvice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArxOne%2FMrAdvice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArxOne","download_url":"https://codeload.github.com/ArxOne/MrAdvice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252329506,"owners_count":21730628,"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","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":["advice","aop","aspects","assembly","inject-aspects"],"created_at":"2024-11-13T04:52:14.004Z","updated_at":"2025-05-04T11:31:27.468Z","avatar_url":"https://github.com/ArxOne.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# Mr. Advice\n\n## Summary\n\nMr. Advice is an open source (and free of charge) alternative to PostSharp (which is still far more advanced, see https://www.postsharp.net).  \nIt intends to inject aspects at build-time. Advices are written in the form of attributes, and marking methods with them makes the pointcut, resulting in a nice and easy aspect injection.  \nMore information about what is an aspect at [Wikipedia](https://en.wikipedia.org/wiki/Aspect-oriented_programming).  \n\nMr. Advice can weave assemblies for:\n\n* .NET framework ≥4.6.1 / Mono\n* .NET ≥5\n* .NET Standard 2.0\n\nMr. Advice allows you to:\n* Advise methods or parameters, at assembly, type, method or parameter level\n* Advice types (at assembly startup)\n* Introduce fields\n* Advise Mr. Advice (and this is **BIG**) at weaving-time (during build step), so you can rename methods as they are advised, add properties, etc.\n\n## How it works\n\nIt is available as a [![NuGet Status](https://img.shields.io/nuget/v/MrAdvice.svg?style=flat-square)](https://www.nuget.org/packages/MrAdvice) package. There is also an automatic build with tests at appveyor. The current status is [![Build status](https://ci.appveyor.com/api/projects/status/96i8xbxf954x79vw?svg=true)](https://ci.appveyor.com/project/picrap/mradvice)\n\n\n## Philosophy\n\nCurrently, MrAdvice won't bring you any aspect out-of-the-box.\nThis means you'll have to write your own aspects (however you can see below other packages using Mr. Advice).  \nSo it brings us to the next chapter, which is...\n\n## How to implement your own aspects\n\n### In a nutshell\n\nHere is the minimal sample:\n```csharp\npublic class MyProudAdvice : Attribute, IMethodAdvice\n{\n    public void Advise(MethodAdviceContext context)\n    {\n        // do things you want here\n        context.Proceed(); // this calls the original method\n        // do other things here\n    }\n}\n```\nYou then just need to mark the method(s) with the attribute and that's it, your aspect is injected!\n\n```csharp\n[MyProudAdvice]\npublic void MyProudMethod()\n{\n}\n```\n\n### More details\n\nYour aspects can be injected at assembly, type or method level, simply by setting the attribute:\n\n* When an aspect is injected at asembly level, all methods of all types are weaved.\n* When the aspect is injected at type level, all of its methods are weaved.\n* And of course, if the aspect is injected on a method, only the method is weaved.\n\n## Other projects using Mr. Advice\n\nNuGet packages:\n * [MrAdvice.MVVM](https://github.com/ArxOne/MrAdvice.MVVM) and its [NuGet package](https://www.nuget.org/packages/MrAdvice.MVVM/), an MVVM implementation using aspects.\n * [Persistence](https://github.com/ArxOne/Persistence) and its [NuGet package](https://www.nuget.org/packages/ArxOne.Persistence/), a library that helps persisting properties in registry with a simple attribute.\n\nMiscellaneous projects:\n\n * [The Blue Dwarf](https://github.com/picrap/BlueDwarf), a tunneling anti-censorship local proxy.\n\n## Contact and links\n\nProject owner is [picrap](https://github.com/picrap), feel free to drop a mail :email:.  \nProject company is [Arx One](https://arx.one), a french company editor of backup software solutions.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArxOne%2FMrAdvice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArxOne%2FMrAdvice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArxOne%2FMrAdvice/lists"}