Soenneker.Utils.Method 4.0.461

Prefix Reserved
dotnet add package Soenneker.Utils.Method --version 4.0.461
                    
NuGet\Install-Package Soenneker.Utils.Method -Version 4.0.461
                    
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.Utils.Method" Version="4.0.461" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.Method" Version="4.0.461" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.Method" />
                    
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.Utils.Method --version 4.0.461
                    
#r "nuget: Soenneker.Utils.Method, 4.0.461"
                    
#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.Utils.Method@4.0.461
                    
#: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.Utils.Method&version=4.0.461
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Method&version=4.0.461
                    
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.Utils.Method

Returns the calling member's name through C#'s CallerMemberName compiler feature.

Installation

dotnet add package Soenneker.Utils.Method

Quick start

using Soenneker.Utils.Method;

Call the static MethodUtil methods directly; no dependency-injection registration is required.

Usage

public void ProcessOrder()
{
    string memberName = MethodUtil.Get();
    // "ProcessOrder"
}

public string DiagnosticName => MethodUtil.Get();
// "DiagnosticName"

Get uses C#'s CallerMemberName attribute. The compiler supplies the containing member's name at the call site, so the utility does not inspect a stack trace and the result follows ordinary symbol renames. It can report methods, properties, and other supported member contexts.

The optional parameter is public because CallerMemberName requires it, but normal calls should omit it. Passing a value explicitly returns that value instead of the caller's name:

string name = MethodUtil.Get("custom"); // "custom"

This helper returns only the member name. It does not include the declaring type, namespace, signature, source path, or line number.

Product Compatible and additional computed target framework versions.
.NET 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.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Soenneker.Utils.Method:

Package Downloads
Soenneker.Redis.Util

The general purpose utility library leveraging Redis for all of your caching needs

Soenneker.Cosmos.Repository

A data persistence abstraction layer for Cosmos DB

Soenneker.Google.SearchIndex

Publishes Google Indexing API URL notifications and retrieves their notification metadata.

Soenneker.Zelos.Repository

A data persistence abstraction layer for Zelos DB

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.461 599 8/31/2026
4.0.460 108 8/30/2026
4.0.459 1,235 8/29/2026
4.0.458 54 8/29/2026
4.0.457 11,820 7/27/2026
4.0.456 4,427 7/16/2026
4.0.455 7,934 6/18/2026
4.0.453 12,819 4/23/2026
4.0.452 4,562 3/20/2026
4.0.447 5,867 3/10/2026
4.0.446 1,685 3/9/2026
4.0.445 315 3/9/2026
4.0.444 4,061 3/4/2026
4.0.443 20,311 1/2/2026
4.0.442 7,577 11/20/2025
4.0.441 5,326 10/29/2025
3.0.440 9,876 9/3/2025
3.0.439 4,477 8/11/2025
3.0.438 8,288 6/27/2025
3.0.437 6,659 5/27/2025
Loading failed

Clarify caller member helper