Moclawr.Core
2.1.0
dotnet add package Moclawr.Core --version 2.1.0
NuGet\Install-Package Moclawr.Core -Version 2.1.0
<PackageReference Include="Moclawr.Core" Version="2.1.0" />
<PackageVersion Include="Moclawr.Core" Version="2.1.0" />
<PackageReference Include="Moclawr.Core" />
paket add Moclawr.Core --version 2.1.0
#r "nuget: Moclawr.Core, 2.1.0"
#addin nuget:?package=Moclawr.Core&version=2.1.0
#tool nuget:?package=Moclawr.Core&version=2.1.0
Moclawr.Core
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 | Versions 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. |
-
net9.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Moclawr.Shared (>= 2.0.1)
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.
Added improved XML documentation and bug fixes.