DKDev.Core 1.0.1

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

DKDev.Core

wakatime .NET C# NuGet License

Lightweight utilities and extensions for .NET applications. Zero dependencies.

Installation

dotnet add package DKDev.Core

Features

  • Guard Clauses - Parameter validation helpers
  • String Extensions - Common string operations
  • URL Validation - HTTP/HTTPS link checking

Usage

Guard Clauses

using DKDev;

public class UserService
{
    public void CreateUser(string username, string email)
    {
        Guard.NotNullOrWhiteSpace(username, nameof(username));
        Guard.NotNullOrWhiteSpace(email, nameof(email));
        
        // Your logic here
    }
}

String Extensions

using DKDev.Extensions;

string text = "  hello world  ";

if (text.HasValue())
{
    var truncated = text.Truncate(10);        // "hello w..."
    var withSlash = text.EnsureEndsWith("/"); // "  hello world  /"
}

URL Validation

using DKDev;

string url = "https://example.com";

if (LinkCheck.IsHttpUrl(url))
{
    // Valid HTTP/HTTPS URL
}

API Reference

Guard

  • NotNull<T>(T value, string paramName) - Throws if null
  • NotNullOrEmpty(string value, string paramName) - Throws if null/empty
  • NotNullOrWhiteSpace(string value, string paramName) - Throws if null/empty/whitespace
  • InRange<T>(T value, string paramName, T min, T max) - Throws if outside range

StringExtensions

  • IsNullOrEmpty() - Check if null or empty
  • IsNullOrWhiteSpace() - Check if null, empty, or whitespace
  • HasValue() - Check if has meaningful value
  • Truncate(int maxLength, string suffix = "...") - Truncate with suffix
  • EnsureEndsWith(string suffix) - Append suffix if missing
  • EnsureStartsWith(string prefix) - Prepend prefix if missing

LinkCheck

  • IsHttpUrl(string value) - Validate HTTP/HTTPS URL

License

MIT

Author

Dominik Karczewski

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 was computed.  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 was computed.  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.
  • net8.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
1.0.1 122 2/21/2026
1.0.0 113 2/21/2026