Oc6.Library 4.0.7
Oc6.Library
A comprehensive .NET library providing utilities and extensions for common development tasks including ASP.NET Core web applications, mathematical computations, text processing, networking, time handling, and more.
Table of Contents
- GlobalConfig
- AspNetCore
- Collections
- Localization
- Locking
- Logging
- Maths
- Migrations
- Net
- Resources
- Text
- Time
GlobalConfig
Assembly configuration file that makes internal types visible to the test project.
Usage:
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Oc6.Library.Tests")]
AspNetCore
ASP.NET Core utilities for building web applications. This namespace contains several sub-modules:
Auth
Authentication and authorization utilities for ASP.NET Core applications. See Auth README for details on:
- Multi-scheme authentication (API Key, Oc6Auth)
Oc6AuthorizeAttributefor attribute-based authorization- Authentication validation endpoints
DependencyInjection
Automatic dependency injection and application configuration utilities. See DependencyInjection README for details on:
AutoDependencyInjectAttributefor automatic service registrationIWebApplicationConfiguratorfor structured app configuration- CORS configuration extensions
Options
Automatic configuration binding for the IOptions pattern. See Options README for details on:
AutoIOptionsAttributefor automatic options registration- Configuration binding utilities
- Built-in configuration classes
TimeService
Testable time services for ASP.NET Core applications. See TimeService README for details on:
IDateTimeOffsetServiceinterfaceScopeDateTimeOffsetServicefor scope-based consistent timeFixedDateTimeOffsetServicefor testing
Collections
Extension methods and utilities for working with collections. See Collections README for details on:
Shuffle()- Fisher-Yates shuffle algorithm for lists and arraysTakeAndRemoveLast()- Remove and return the last element
Localization
ISO standard enumerations for internationalization. See Localization README for details on:
CountryCode- ISO 3166-1 alpha-2 country codesCultureCode- Language and region combinationsCurrencyCode- ISO 4217 currency codes
Locking
Thread-safe async locking mechanisms. See Locking README for details on:
AsyncLock<TType>- Generic async lock using SemaphoreSlimAsyncLockFactory- Factory for creating singleton lock instances
Logging
Structured logging system for ASP.NET Core. See Logging README for details on:
- Audit logging middleware
- Exception handler middleware
- JSON serialization to console
Maths
Mathematical utilities and numerical computations. See Maths README for details on:
DecimalMath- High-precision decimal mathematicsDoubleMath- Double-precision operationsFraction- Rational number representationIntegerMath- Integer operationsLoanFunctions- Financial calculationsNewtonRaphson- Root-finding algorithm
Migrations
Entity Framework Core database migrations for the Oc6Auth system.
Initial Migration (20251002151834)
Creates the DataProtectionKeys table for ASP.NET Core Data Protection.
Table Structure:
Id(int, primary key, identity)FriendlyName(nvarchar(max), nullable)Xml(nvarchar(max), nullable)
Usage:
# Apply migrations
dotnet ef database update --project Oc6.Library.DbHost
Net
Network utilities for IP addresses, REST clients, and web push. See Net README for details on:
- IP Range - CIDR notation and IP range operations
- REST - HTTP client utilities
- WebPush - Web push notification support
Resources
Localized error message resources for the library.
ErrorMessages
Auto-generated resource class providing strongly-typed access to error messages.
Available Messages:
InvalidAddressSize- "Invalid address size"InvalidMask- "Invalid mask"InvalidState- "Invalid state"ListCannotBeEmpty- "List cannot be empty"ListCannotBeNull- "List cannot be null"
Usage:
using Oc6.Library.Resources;
throw new ArgumentException(ErrorMessages.ListCannotBeEmpty);
Note: This is an internal class. Error messages are accessed internally by the library and are not intended for direct external use.
Text
Text processing and string manipulation utilities. See Text README for details on:
Levenshtein- Edit distance computationStringManipulation- Common string operations
Time
Date and time utilities including simplified date-time structures. See Time README for details on:
SimpleDateTime- Timezone-free date-time struct (ISO 8601)SimpleDateTimeJsonConverter- JSON serializationSimpleDateTimeValueConverter- Entity Framework Core value converterPropertyBuilderExtensions- EF Core property configuration
Showing the top 20 packages that depend on Oc6.Library.
| Packages | Downloads |
|---|---|
|
Oc6.Queue.Client
Provides a QueueClient to enables access to features in the queue.oc6.dk ecosystem.
|
6 |
|
Oc6.Queue.Client
Provides a QueueClient to enables access to features in the queue.oc6.dk ecosystem.
|
4 |
|
Oc6.Queue.Client
Provides a QueueClient to enables access to features in the queue.oc6.dk ecosystem.
|
3 |
|
Oc6.Queue.Client
Provides a QueueClient to enables access to features in the queue.oc6.dk ecosystem.
|
2 |
|
Oc6.Queue.Client
Provides a QueueClient to enables access to features in the queue.oc6.dk ecosystem.
|
1 |
.NET 10.0
- Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (>= 10.0.0)
- Microsoft.EntityFrameworkCore.InMemory (>= 10.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.0)