Moclawr.Core 2.1.0

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

Moclawr.Core

NuGet

Overview

Moclawr.Core provides essential utility extension methods and base functionality for .NET applications. This library serves as the foundation for other Moclawr packages, offering extensions for common operations that simplify development across various .NET projects.

Features

  • Extension Methods: Comprehensive set of extensions for enums, objects, queryables, reflection, and strings
  • Assembly Scanning: Tools for discovering and loading types from assemblies
  • LINQ Enhancements: Advanced query capabilities with dynamic ordering and filtering
  • Configuration Utilities: Helpers for working with .NET configuration

Installation

dotnet add package Moclawr.Core

Usage Examples

Queryable Extensions

// Dynamic ordering with string property name
var orderedCustomers = customers.OrderByDynamic("LastName", true);

// Async conversion to immutable array
var itemsArray = await queryable.ConvertToImmutableArrayAsync(cancellationToken);

Enum Extensions

// Get description attribute from enum value
var description = MyEnum.SomeValue.GetDescription();

// Convert string to enum value
var enumValue = "Active".ToEnum<Status>();

String Extensions

// Normalize a string (remove diacritics)
var normalized = "Café".NormalizeString();

// Check if string matches a wildcard pattern
bool isMatch = filename.MatchesWildcard("doc*.txt");

Integration with Other Moclawr Packages

Moclawr.Core is designed to work seamlessly with other packages in the Moclawr ecosystem, particularly:

  • Moclawr.Shared: Provides foundational interfaces and response models that use Core extensions
  • Moclawr.Domain: For domain modeling and business logic that leverages Core utilities
  • Moclawr.EfCore and Moclawr.MongoDb: For data access operations using Core query extensions
  • Moclawr.Host: Uses Core configuration utilities and extension methods
  • Moclawr.MinimalAPI: Leverages Core extensions for endpoint and request handling
  • Moclawr.Services.Caching: Uses Core constants and configuration extensions

Requirements

  • .NET 9.0 or higher

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

Showing the top 5 NuGet packages that depend on Moclawr.Core:

Package Downloads
Moclawr.MinimalAPI

Minimal API utilities with MediatR integration for .NET 9. Provides a class-based approach to endpoint definition with built-in CQRS support and SwaggerUI.

Moclawr.Services.Autofac

Autofac integration for the moclaw project. Provides seamless integration with Autofac dependency injection container.

Moclawr.DotNetCore.CAP

Enhanced implementation of DotNetCore.CAP for message brokers like RabbitMQ, Kafka, Redis, and others. Simplifies integration of event-based microservices.

Moclawr.Services.Caching

Flexible caching solution for .NET applications, with support for Redis and in-memory caching strategies.

Moclawr.Host

Host utilities and base types for the moclaw project. Provides essential infrastructure for building robust ASP.NET Core applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 334 5/28/2025
2.0.0 179 5/24/2025
1.0.3 93 5/24/2025
1.0.2 174 5/22/2025
1.0.1 164 5/21/2025
1.0.0 242 5/15/2025

Added improved XML documentation and bug fixes.