Devlord.Utilities 7.0.1

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

Devlord.Utilities

A useful class library for universal utilities like consuming RESTful APIs.

Main Develop NuGet
.NET .NET NuGet

To install Devlord.Utilities, run the following command in the Package Manager Console:

PM> Install-Package Devlord.Utilities

Or from the command-line:

dotnet add package Devlord.Utilities

Breaking Changes

  • Mail utilities have been moved to the Devlord.Utilities.Mail package.
  • Maps API utilities have been moved to the Devlord.Utilities.MapsApi package.
  • Encryption has been deprecated because the protocols are no longer recommended.
  • UnderscoreContractResolver has been removed in favor of System.Text.Json snake case handling.
  • ValueText.Value has been changed from string to decimal.

Feature Summary

  • .NET Core compatibility
  • System.Threading.Timers service clocks
  • Email throttling to help you avoid being suspended by your ISP
  • Generic HTTP API wrappers
  • "Micro-ORM" DataReader mapper for when using a full-featured ORM would be overkill

More details below, but for even more details, see the project wiki.

Service Timers

We've provided 3 types of timers for back-end services to execute operations

  • At a certain time
  • At a certain regular interval
  • Continuously, repeating an action as soon as the previous action is complete

ApiCall

The ApiCall class wraps the .NET HttpClient, and returns a deserialized object using Generics. It also features a Dictionary for query parameter input. The WebApiCall subclass will build your endpoint for ASP.NET MVC Web API based on the supplied controller, action, and id as input parameters.

Distance API

POCO classes for accessing the Google Maps distance API.

Usage with a custom JSON contract resolver that converts the Google JSON property names to POCO object properties.

    const string BaseUri = "https://maps.googleapis.com/maps/api/distancematrix/json";

    using (IApiCall client = new ApiCall(BaseUri,
            new JsonSerializerSettings { ContractResolver = new UnderscoreContractResolver() }))
    {
        client.QueryParams.Add("sensor", "false");
        client.QueryParams.Add("origins", "95969");
        client.QueryParams.Add("destinations", "95928");
        IApiResult<dynamic> result = client.Execute<DistanceResults>();
    }

DataManager

A handy generic DataManager abstract base class for your business layer that serves to enforce a CRUD contract between your business entities and your data layer. Useful for pagination as well.

Mailbot

A multithreaded SMTP queued mail sender, has a configurable throttle for mail frequency sent by a single account.

Configuration

{
  "Devlord.Utilities": {
    "GoogleMapsApiKey": "",
    "MailSettings": [
      {
        "Name": "Gmail",
        "SmtpServer": "mail.google.com",
        "SmtpPort": 587,
        "SmtpPassword": "",
        "MaxPerMinute": 500,
        "MaxPerHour": 500,
        "MaxPerDay": 500
      }
    ]
  }
}

DRMapper

Allows mapping of an IDataReader to POCO classes using reflection. It's faster than you might expect.

Pagination

    var query = from a in context.Addresses where a.IsActive select a;
    var results = query.GetPage(pageNumber, pageSize); 

Contributing

Yes, please!

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Contact lorddev on GitHub or @devlord@hachyderm.io on Mastodon.

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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Devlord.Utilities:

Package Downloads
Devlord.Utilities.Mail

Package Description

Devlord.Utilities.MapsApi

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.1 132 2/28/2026
7.0.1-preview.14 57 2/28/2026
7.0.1-preview 129 2/28/2026
7.0.0-preview.8 52 2/21/2026
6.0.0 548 12/5/2022
5.0.123 1,926 4/9/2017
5.0.113 2,202 4/6/2017
5.0.0.232 1,772 4/3/2017
4.0.1 1,411 3/27/2017