# Metalama generates C\# patterns and enforces architecture at build time

Canonical source : [Metalama generates C\# patterns and enforces architecture at build time](<https://sebastien.rigaux.be/en/tech-watch/links/metalama-generates-c-patterns-and-enforces-architecture-at-build-time>)

Metalama automates cross-cutting C# patterns with aspects that generate code at compile time, while checking architecture rules as you edit. The repetitive implementation stays out of business code and the repository, and one aspect can be applied to a method or to a set of methods selected in code.

For example, an aspect can wrap a method in `try/catch` to log its entry, result, and exceptions. Metalama also lets you preview and debug the transformed code, making those changes inspectable.

- Selected on : 2026-10-30

- Entry updated : 2026-10-30T20:18:15+0000

- Format : Tool

- Source language : EN

- Found via : [C\# Digest](<https://csharpdigest.net/>)

Original resource : [Metalama generates C\# patterns and enforces architecture at build time](<https://postsharp.net/metalama>)

Tags : [C\#](<https://sebastien.rigaux.be/en/tech-watch/tags/c-sharp>) · [.NET](<https://sebastien.rigaux.be/en/tech-watch/tags/dotnet>) · [Software Architecture](<https://sebastien.rigaux.be/en/tech-watch/tags/software-architecture>) · [Developer Experience](<https://sebastien.rigaux.be/en/tech-watch/tags/developer-experience>)

Available versions : [Français](<https://sebastien.rigaux.be/veille/liens/metalama-generer-des-patterns-c-et-faire-appliquer-larchitecture-au-build>) · [English](<https://sebastien.rigaux.be/en/tech-watch/links/metalama-generates-c-patterns-and-enforces-architecture-at-build-time>)

[Back to tech watch](<https://sebastien.rigaux.be/en/tech-watch>)
