Soenneker.Extensions.MethodInfo
4.0.383
Prefix Reserved
dotnet add package Soenneker.Extensions.MethodInfo --version 4.0.383
NuGet\Install-Package Soenneker.Extensions.MethodInfo -Version 4.0.383
<PackageReference Include="Soenneker.Extensions.MethodInfo" Version="4.0.383" />
<PackageVersion Include="Soenneker.Extensions.MethodInfo" Version="4.0.383" />
<PackageReference Include="Soenneker.Extensions.MethodInfo" />
paket add Soenneker.Extensions.MethodInfo --version 4.0.383
#r "nuget: Soenneker.Extensions.MethodInfo, 4.0.383"
#:package Soenneker.Extensions.MethodInfo@4.0.383
#addin nuget:?package=Soenneker.Extensions.MethodInfo&version=4.0.383
#tool nuget:?package=Soenneker.Extensions.MethodInfo&version=4.0.383
Soenneker.Extensions.MethodInfo
Builds compact diagnostic method signatures and maps compiler-generated accessor names back to their member names.
Installation
dotnet add package Soenneker.Extensions.MethodInfo
Build a diagnostic signature
using Soenneker.Extensions.MethodInfo;
MethodInfo method = typeof(CustomerService).GetMethod(nameof(CustomerService.Find))!;
string signature = method.GetSignature();
// Example: "public virtual Customer Find(String id)"
GetSignature() includes:
- The reflection access level.
- One of
abstract,static, or unsealedvirtualwhen applicable. - The return type's simple
Name. - The method name.
- Each parameter type's simple
Nameand parameter name.
The result is cached for the lifetime of the MethodInfo object. A null method returns an empty string.
This output is intended for logs, diagnostics, and display. It is not guaranteed to be valid C# or a unique method identifier: namespaces, declaring type, generic arguments, custom modifiers, attributes, default values, and complete ref/out syntax are not rendered. Use metadata tokens or a purpose-built canonical representation when identity matters.
Recover a property or event name
MethodInfo getter = typeof(Customer).GetProperty(nameof(Customer.Name))!.GetMethod!;
string memberName = getter.ToOriginalMemberName(); // "Name"
For special-name methods, ToOriginalMemberName() removes get_, set_, add_, or remove_. For another special name containing an underscore, it returns the text after the first underscore—for example, op_Addition becomes Addition. A non-special method keeps its name, and a null method returns an empty string.
The method performs name transformation only; it does not resolve and return the associated PropertyInfo or EventInfo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.Extensions.MethodInfo:
| Package | Downloads |
|---|---|
|
Soenneker.Reflection.Cache
The fastest .NET Reflection cache |
|
|
Soenneker.Utils.BackgroundQueue
A high-performance background Task/ValueTask queue |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.383 | 370 | 10/14/2026 |
| 4.0.382 | 43 | 10/14/2026 |
| 4.0.377 | 6,947 | 10/12/2026 |
| 4.0.376 | 141 | 10/12/2026 |
| 4.0.375 | 30,022 | 10/11/2026 |
| 4.0.374 | 130,807 | 9/24/2026 |
| 4.0.373 | 42,358 | 9/15/2026 |
| 4.0.372 | 52,246 | 9/12/2026 |
| 4.0.371 | 150,678 | 8/30/2026 |
| 4.0.370 | 2,767 | 8/29/2026 |
| 4.0.369 | 222,365 | 7/27/2026 |
| 4.0.368 | 111,060 | 7/16/2026 |
| 4.0.367 | 145,484 | 6/18/2026 |
| 4.0.366 | 130,629 | 6/5/2026 |
| 4.0.365 | 4,574 | 6/5/2026 |
| 4.0.364 | 214,248 | 4/22/2026 |
| 4.0.363 | 127,761 | 3/14/2026 |
| 4.0.362 | 7,216 | 3/12/2026 |
| 4.0.361 | 415 | 3/12/2026 |
| 4.0.358 | 54,430 | 3/10/2026 |
Update dependency dotnet-sdk to v10.0.402 (#479)