SoulNETLib.Common 0.4.6

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

SoulNETLib.Common

A lightweight collection of extension methods for everyday .NET development. Reduces boilerplate across strings, enums, collections, claims, and more.

Installation

dotnet add package SoulNETLib.Common

Requirements: .NET 10+

What's Included

Category Key Methods
String OrEmptyIfNull, RemoveWhitespaces, TryRemoveEnd, TryRemoveStart, FirstCharToUpper, GetDigitsInt
Enum GetDescription, GetEnumMember, TryParseEnumMember
IEnumerable OrEmptyIfNull, WhereIf
IQueryable WhereIf (expression tree variant)
List Replace, ReplaceAll
Object HasProperty, CopyPropertyValuesFrom
Claims GetUserId
Exception GetDetailMessage

Quick Start

Conditional filtering

using SoulNETLib.Common.Extension;

// Apply filter only when a value is provided — works with IQueryable and IEnumerable
var results = query
    .WhereIf(!string.IsNullOrEmpty(searchTerm), x => x.Name.Contains(searchTerm))
    .WhereIf(categoryId.HasValue, x => x.CategoryId == categoryId);

Enum utilities

using SoulNETLib.Common.Extension;

public enum Status
{
    [Description("In Progress")]
    InProgress,

    [EnumMember(Value = "done")]
    Completed
}

var description = Status.InProgress.GetDescription(); // "In Progress"
var member = Status.Completed.GetEnumMember();         // "done"

if ("done".TryParseEnumMember<Status>(out var parsed))
{
    // parsed == Status.Completed
}

Null-safe collections

using SoulNETLib.Common.Extension;

IEnumerable<string>? possiblyNull = GetItems();
var safe = possiblyNull.OrEmptyIfNull(); // never null

string? name = GetName();
var safeName = name.OrEmptyIfNull(); // ""

Feedback

Found a bug or have a suggestion? Open an issue on GitHub.

Contributing

Contributions are welcome! Fork the repository, make your changes, and submit a pull request. Please ensure all existing tests pass.

License

This package is licensed under the MIT License.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.6 227 5/23/2026
0.4.5 114 5/18/2026
0.4.4 117 5/17/2026
0.4.3 180 5/11/2026
0.4.2 119 5/7/2026
0.4.1 97 5/6/2026
0.4.0 94 5/6/2026
0.3.0 226 3/13/2026
0.2.3 346 6/27/2025