{"id":26515413,"url":"https://github.com/metalama/metalama","last_synced_at":"2026-01-24T14:19:19.861Z","repository":{"id":45164862,"uuid":"314225240","full_name":"metalama/Metalama","owner":"metalama","description":"Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.","archived":false,"fork":false,"pushed_at":"2025-03-18T00:41:18.000Z","size":60646,"stargazers_count":186,"open_issues_count":16,"forks_count":6,"subscribers_count":5,"default_branch":"release/2025.1","last_synced_at":"2025-03-18T07:16:17.599Z","etag":null,"topics":["compiler","csharp","dotnet","metalama"],"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/metalama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-11-19T11:20:17.000Z","updated_at":"2025-03-18T00:42:17.000Z","dependencies_parsed_at":"2022-07-18T09:09:21.414Z","dependency_job_id":"f601926a-0a94-4b53-aa82-1ccf3a193f5d","html_url":"https://github.com/metalama/Metalama","commit_stats":{"total_commits":66,"total_committers":7,"mean_commits":9.428571428571429,"dds":0.2727272727272727,"last_synced_commit":"51b8a9b0879b49829513ac5d85b05c12a2afea93"},"previous_names":["postsharp/caravela","metalama/metalama","postsharp/metalama"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalama%2FMetalama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalama%2FMetalama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalama%2FMetalama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalama%2FMetalama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metalama","download_url":"https://codeload.github.com/metalama/Metalama/tar.gz/refs/heads/release/2025.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"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":["compiler","csharp","dotnet","metalama"],"created_at":"2025-03-21T06:09:25.065Z","updated_at":"2026-01-05T17:16:29.214Z","avatar_url":"https://github.com/metalama.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"450\" src=\"images/metalama.svg\" alt=\"Metalama logo\" /\u003e\n\u003c/p\u003e\n\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10558/badge)](https://www.bestpractices.dev/projects/10558) \n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/metalama/Metalama/badge)](https://scorecard.dev/viewer/?uri=github.com/metalama/Metalama)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Metalama.Compiler)](https://www.nuget.org/packages?q=Metalama\u0026includeComputedFrameworks=true\u0026prerel=true\u0026sortby=totalDownloads-desc)\n[![GitHub Release](https://img.shields.io/github/v/release/metalama/Metalama)](https://github.com/metalama/Metalama/releases)\n\n\n**Metalama is a Roslyn-based meta-programming framework for code generation, architecture validation, and aspect-oriented programming in C#.**\n\nIt lets you write cleaner, more maintainable .NET code by automating repetitive patterns at compile time using aspects, templates, and compile-time logic. It integrates tightly with the Roslyn compiler, providing full control over how your code is built.\n\n## Why Metalama?\n\n- **Write and maintain less code**: Eliminate boilerplate by generating it dynamically during compilation, reducing code lines and bugs by up to 15%.\n- **Validate your codebase in real time**: Enforce adherence to design rules and conventions without waiting for code reviews.\n- **Excel with large, complex, or legacy codebases**: Metalama shines at scale and does not require architectural changes.\n\n## When to use it?\n\nMetalama is ideal for:\n\n- **Large projects**: Automate repetitive patterns across dozens of entities and hundreds of properties or methods.\n- **Large teams**: Align developers on consistent patterns and practices.\n- **Long lifecycle projects**: Maintain quality over years of development.\n\nIt's main use cases are:\n\n- **Design Patterns**: [Singleton](https://metalama.net/applications/classic-singleton), [Memento](https://metalama.net/applications/memento), [Factory](https://metalama.net/applications/factory), [Builder](https://metalama.net/applications/builder), [Decorator](https://metalama.net/applications/decorator), [Proxy](https://metalama.net/applications/proxy), ...\n- **UI Patterns**: [INotifyPropertyChanged](https://metalama.net/applications/inotifypropertychanged), [Change Tracking](https://metalama.net/applications/command), [Memoization](https://metalama.net/applications/memoization), [Undo/Redo](https://metalama.net/applications/undo-redo), [Command](https://metalama.net/applications/command), [Dependency Properties](https://metalama.net/applications/dependency-property), ...\n- **Object Services**: [Cloning](https://metalama.net/applications/cloning), [ToString](https://metalama.net/applications/tostring), [Comparison](https://metalama.net/applications/equatable), ...\n- **Defensive Programming**: [Code Contracts](https://metalama.net/applications/contracts) (preconditions, post-conditions, invariants)\n- **DevOps**: [Logging \u0026 Tracing](https://metalama.net/applications/logging), [Metrics](https://metalama.net/applications/metrics), [Caching](https://metalama.net/applications/caching), [Exception Handling](https://metalama.net/applications/exception-handling)\n- [Architecture Validation](https://metalama.net/applications/architecture-verification) 💎\n- [Refactoring](https://metalama.net/applications/refactoring)\n- In general, [Clean Code](https://metalama.net/applications/clean-code) and [SOLID \u0026 DRY Principles](https://metalama.net/applications/solid)\n\n\n## License\n\nMetalama is released under the [MIT license](LICENSE.md).\n\nSome optional extensions and IDE tooling are released under a proprietary license and are marked with a diamond 💎 symbol.\n\n## Features\n\n- [Code Generation](https://metalama.net/features/code-generation)\n- [Code Validation](https://metalama.net/features/code-validation)\n- [Immediate Editor Feedback](https://metalama.net/features/architecture-verification)\n- [Code Fix Toolkit](https://metalama.net/features/code-fixes) 💎\n- [Ready-to-Use Aspect Libraries](https://metalama.net/features/aspect-libraries)\n- [Visual Studio Tooling](https://metalama.net/features/tooling) 💎\n- [Test Frameworks](https://metalama.net/features/testing)\n- [Debugging of Transformed Code](https://metalama.net/features/debugging)\n- [Roslyn Extensibility SDK](https://metalama.net/features/roslyn)\n- [Code Query API](https://metalama.net/features/code-query)\n\n## Resources\n\n- 🌐 [Metalama Website](https://metalama.net)\n- 📖 [Documentation](https://doc.metalama.net)\n- 📝 [Annotated Examples](https://doc.metalama.net/examples)\n- 📢 [Release Notes](https://doc.metalama.net/conceptual/release-notes)\n- 📜 [Builds](https://github.com/metalama/Metalama/releases)\n- ✨ [Metalama Tools for Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=PostSharpTechnologies.PostSharp)\n\n## Quick Start\n\n1. Add the `Metalama.Framework` package to your project:\n\n    ```powershell\n    dotnet add package Metalama.Framework\n    ```\n\n2. Optionally, install [Metalama Tools for Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=PostSharpTechnologies.PostSharp). It's free for individuals, non-commercial uses, and companies with up to 3 users.\n\n3. Explore the [Metalama Marketplace](https://metalama.net/marketplace) for ready-made aspects or examples.\n\n4. Follow the [Getting Started](https://doc.metalama.net/conceptual/getting-started) guide to create your first aspect.\n\n## Contributing\n\nWe welcome contributions! Here's how you can help:\n\n- ⭐ Star this repository or review us on [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=PostSharpTechnologies.PostSharp).\n- 📝 Write a blog post or record a video about Metalama.\n- 📦 Share your aspects on the [Metalama Marketplace](https://metalama.net/marketplace).\n- 🛠️ Contribute to [Metalama.Community](https://github.com/metalama/Metalama.Community).\n- 📚 Improve the documentation. [Learn how](https://metalama.net/contributing/contribute-docs).\n- 🐛 Fix bugs or contribute code. [Learn how](https://metalama.net/contributing/contribute-code).\n\nFor more details, see [Contributing to Metalama](https://metalama.net/contributing).\n\n## Support \u0026 Community\n\n- Report issues on GitHub. Follow [these recommendations](https://metalama.net/contributing/file-an-issue).\n- Join [GitHub discussions](https://github.com/orgs/metalama/discussions) for questions and proposals.\n- Enterprise support is available. Learn more about [premium support](https://metalama.net/premium/enterprise-support). 💎\n- Please review our [Community Guidelines](https://metalama.net/contributing/guidelines).\n\n## Packages\n\nBelow is a list of packages originating from this repository:\n\n| Package Name                                                                                          |Description                                                                                           |\n|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| [Metalama.Framework](https://www.nuget.org/packages/Metalama.Framework/)                             |  This is the public API of the Metalama Framework. It incorporates a reference to Metalama.Compiler, effectively replacing the Roslyn compiler with our custom version.  |\n| [Metalama.Testing.UnitTesting](https://www.nuget.org/packages/Metalama.Testing.UnitTesting/)          |  Provides base classes and utilities for unit testing compile-time code.   |\n| [Metalama.Testing.AspectTesting](https://www.nuget.org/packages/Metalama.Testing.AspectTesting/)      |  A framework based on xUnit for testing code generation by aspects.   |\n| [Metalama.Framework.Redist](https://www.nuget.org/packages/Metalama.Framework.Redist/)               |  Similar to `Metalama.Framework`, but excludes the dependency on `Metalama.Compiler`.   |\n| [Metalama.Framework.Sdk](https://www.nuget.org/packages/Metalama.Framework.Sdk/)                     |  Facilitates the use of the Roslyn API from aspects.   |\n| [Metalama.Framework.Engine](https://www.nuget.org/packages/Metalama.Framework.Engine/)               |  This is the core implementation of `Metalama.Framework`. Direct referencing of this package is discouraged and unsupported. It's intended to be a dependency for `Metalama.Testing.AspectTesting`.    |\n| [Metalama.Framework.CompileTimeContracts](https://www.nuget.org/packages/Metalama.Framework.CompileTimeContracts/) |  Defines the public API between compiled T# templates and `Metalama.Framework.Engine`.  |\n| [Metalama.Framework.Introspection](https://www.nuget.org/packages/Metalama.Framework.Introspection/) |  Provides an API to inspect the object model that represents the compilation process of `Metalama.Framework`, such as aspect and advice instances, as well as its results.  |\n| [Metalama.Framework.Workspaces](https://www.nuget.org/packages/Metalama.Framework.Workspaces/)       |  A supplementary API to `Metalama.Framework.Introspection`, designed to facilitate the loading of Visual Studio projects and solutions. This package is also useful to inspect projects that don't use Metalama. It is used by `Metalama.LinqPad`.   |\n| [Metalama.Tool](https://www.nuget.org/packages/Metalama.Tool/)                                       |  The `metalama` tool for the .NET CLI.   |\n| [Metalama.Extensions.DependencyInjection](https://www.nuget.org/packages/Metalama.Extensions.DependencyInjection/) | A framework that allows aspects to consume dependencies from an arbitrary dependency injection framework. |\n| [Metalama.Extensions.Metrics](https://www.nuget.org/packages/Metalama.Extensions.Metrics/)           | Implements code metrics that can be consumed by aspects and fabrics. |\n| [Metalama.Extensions.Multicast](https://www.nuget.org/packages/Metalama.Extensions.Multicast/)       | Simulates the legacy PostSharp attribute multicasting to ease the migration from PostSharp to Metalama. |\n| [Metalama.Extensions.Architecture](https://www.nuget.org/packages/Metalama.Extensions.Architecture/) | Allows you to validate the source code against architecture rules. |\n| [Metalama.Patterns.Caching](https://www.nuget.org/packages/Metalama.Patterns.Caching/)               | Comprehensive caching framework for Metalama.                                                         |\n| [Metalama.Patterns.Caching.Aspects](https://www.nuget.org/packages/Metalama.Patterns.Caching.Aspects/) | Aspects designed for Metalama caching, building upon `Metalama.Patterns.Caching`.                     |\n| [Metalama.Patterns.Caching.Backend](https://www.nuget.org/packages/Metalama.Patterns.Caching.Backend/) | Provides an abstraction over caching backends, including an in-memory caching implementation.         |\n| [Metalama.Patterns.Contracts](https://www.nuget.org/packages/Metalama.Patterns.Contracts/)           | Code contract aspects like `[NotNull]`, `[Url]` for contract-based programming.                       |\n| [Metalama.Patterns.Immutability](https://www.nuget.org/packages/Metalama.Patterns.Immutability/)     | Represents the concept of Immutable Type so that it can be used by other packages like Metalama.Patterns.Observability. |\n| [Metalama.Patterns.Memoization](https://www.nuget.org/packages/Metalama.Patterns.Memoization)         | Implements a memoization aspect, i.e., simple and super-fast caching.                                  |\n| [Metalama.Patterns.Observability](https://www.nuget.org/packages/Metalama.Patterns.Observability)     | A Metalama aspect implementing `INotifyPropertyChanged`.                                              |\n| [Metalama.Patterns.Wpf](https://www.nuget.org/packages/Metalama.Patterns.Wpf)                         | Aspects that implement WPF dependency properties and commands.                                        |\n| [Metalama.LinqPad](https://www.nuget.org/packages/Metalama.LinqPad/)                                 | Provides integration with LINQPad for inspecting projects and solutions.                              |\n| [Flashtrace](https://www.nuget.org/packages/Flashtrace)                                               | A structured tracing library used by `Metalama.Patterns.Caching`.                                     |\n| [Flashtrace.Formatters](https://www.nuget.org/packages/Flashtrace.Formatters)                         | Object formatters used in caching and logging.                                                        ```\n\n## Related Repositories\n\n| Repository                                                                 | License          | Description                                                                 |\n| ------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------- |\n| [Metalama.Compiler](https://github.com/metalama/Metalama.Compiler)        | MIT              | A [Roslyn](https://github.com/dotnet/roslyn) fork for source code transformations. |\n| [PostSharp.Engineering](https://github.com/postsharp/PostSharp.Engineering) | MIT              | A custom multi-repo build and CI framework.                                 |\n| [Metalama.Community](https://github.com/metalama/Metalama.Community)     | MIT              | Community-contributed aspects repository.                                   |\n| [Metalama.Documentation](https://github.com/metalama/Metalama.Documentation) | MIT              | Source for documentation hosted on [Metalama Docs](https://doc.metalama.net/). |\n| [Metalama.Samples](https://github.com/metalama/Metalama.Samples)          | MIT              | Illustrative samples available at [Metalama Examples](https://doc.metalama.net/examples). |\n| [Metalama.Premium](https://github.com/metalama/Metalama.Premium)  💎       | Proprietary      | Extensions available to customers with a commercial license.                      |\n\n## Dependencies\n\nDirect and indirect dependencies, as well as their licensing, are documented in [Third Party Notices](THIRD-PARTY-NOTICES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetalama%2Fmetalama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetalama%2Fmetalama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetalama%2Fmetalama/lists"}