.NETStandard2.0
A Metalama weaver that makes all methods in a type virtual.
Published
Nov 15, 2024
1y ago
Total Downloads
72.3K
72,306
Install
dotnet add package Metalama.Community.Virtuosity --version 2024.2.30
| Product | Versions |
|---|---|
| .NET Standard |
README
Metalama.Community.Virtuosity
Allows you to make all target methods virtual without adding the virtual keyword to every one of them.
This is a Metalama aspect. It modifies your code during compilation by using source weaving.
Example
Your code:
using Metalama.Community.Virtuosity;
[Virtualize]
class A
{
public void M1() { }
protected void M2() { }
private void M3() { }
}
What gets compiled:
class A
{
public virtual void M1() { }
protected virtual void M2() { }
private void M3() { }
}
Installation
- Install the NuGet package:
dotnet add package Metalama.Community.Virtuosity --prerelease. - Apply the aspect to the relavant types by adding the
[Virtualize]attribute to them.
How to use
By annotating a class or a record type with [Virtualize], you make all methods virtual (except those that can't be virtual, like static and private methods).
For more details, see Details.
Changes from Previous Version
No structural changes between v2024.2.29 and v2024.2.30.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.