Soenneker.Extensions.MethodInfo 4.0.371

Prefix Reserved
dotnet add package Soenneker.Extensions.MethodInfo --version 4.0.371
                    
NuGet\Install-Package Soenneker.Extensions.MethodInfo -Version 4.0.371
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Extensions.MethodInfo" Version="4.0.371" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.MethodInfo" Version="4.0.371" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.MethodInfo" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Extensions.MethodInfo --version 4.0.371
                    
#r "nuget: Soenneker.Extensions.MethodInfo, 4.0.371"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Extensions.MethodInfo@4.0.371
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Extensions.MethodInfo&version=4.0.371
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.MethodInfo&version=4.0.371
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 unsealed virtual when applicable.
  • The return type's simple Name.
  • The method name.
  • Each parameter type's simple Name and 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.371 78,318 8/30/2026
4.0.370 2,726 8/29/2026
4.0.369 216,992 7/27/2026
4.0.368 110,387 7/16/2026
4.0.367 138,162 6/18/2026
4.0.366 130,085 6/5/2026
4.0.365 4,553 6/5/2026
4.0.364 206,157 4/22/2026
4.0.363 125,852 3/14/2026
4.0.362 7,198 3/12/2026
4.0.361 396 3/12/2026
4.0.358 54,170 3/10/2026
4.0.357 23,500 3/9/2026
4.0.356 5,054 3/9/2026
4.0.355 134 3/9/2026
4.0.354 58,247 3/4/2026
4.0.353 67,629 2/20/2026
4.0.352 125,875 1/8/2026
4.0.350 164,776 11/20/2025
4.0.349 81,339 10/29/2025
Loading failed

Document MethodInfo formatting limits