![]() |
VOOZH | about |
dotnet add package AbsoluteAlgorithm.Core --version 1.0.4
NuGet\Install-Package AbsoluteAlgorithm.Core -Version 1.0.4
<PackageReference Include="AbsoluteAlgorithm.Core" Version="1.0.4" />
<PackageVersion Include="AbsoluteAlgorithm.Core" Version="1.0.4" />Directory.Packages.props
<PackageReference Include="AbsoluteAlgorithm.Core" />Project file
paket add AbsoluteAlgorithm.Core --version 1.0.4
#r "nuget: AbsoluteAlgorithm.Core, 1.0.4"
#:package AbsoluteAlgorithm.Core@1.0.4
#addin nuget:?package=AbsoluteAlgorithm.Core&version=1.0.4Install as a Cake Addin
#tool nuget:?package=AbsoluteAlgorithm.Core&version=1.0.4Install as a Cake Tool
AbsoluteAlgorithm.Core is a versatile core library designed to support a wide range of applications. It provides essential utilities and infrastructure for building robust and scalable applications.
ApplicationConfiguration using the ApplicationConfigurationBuilder.ApplicationConfiguration throughout the application lifecycle.To create an instance of ApplicationConfiguration, use the ApplicationConfigurationBuilder. Direct instantiation of ApplicationConfiguration is not allowed as it follows the Singleton design pattern.
var configuration = new ApplicationConfigurationBuilder()
.WithDatabasePolicies(databasePolicies)
.WithStoragePolicies(storagePolicies)
.WithHttpClientPolicies(httpClientPolicies)
.WithApiVersioningPolicy(apiVersioningPolicy)
.WithSwaggerPolicy(swaggerPolicy)
.WithIdempotencyPolicy(idempotencyPolicy)
.WithCachingPolicy(cachingPolicy)
.WithAuthManifest(authManifest)
.WithWebhookSignaturePolicies(webhookPolicies)
.WithRateLimitPolicies(rateLimitPolicies)
.EnableHealthChecks(true)
.Build();
Although direct instantiation is deprecated, here is an example for reference:
ApplicationConfiguration appConfig = new ApplicationConfiguration
{
// Enable or disable relational database support (SQL Server, PostgreSQL)
EnableRelationalDatabase = true,
// List of database connection policies (multiple DBs supported)
DatabasePolicies = new List<DatabasePolicy>
{
new DatabasePolicy
{
DatabaseProvider = DatabaseProvider.MSSQL,
ConnectionStringName = "<MSSQL_CONNECTION_STRING_ENVIRONMENT_VARIABLE_NAME>",
InitializeDatabase = true,
InitializeAuditTable = true,
InitializationScript = "<MSSQL_SCRIPT>",
Name = "<KEYED_IDENTIFIER>",
MaxPoolSize = 100,
MinPoolSize = 10,
CommandTimeoutSeconds = 30
},
new DatabasePolicy
{
DatabaseProvider = DatabaseProvider.PostgreSQL,
ConnectionStringName = "<POSTGRESQL_CONNECTION_STRING_ENVIRONMENT_VARIABLE_NAME>",
InitializeDatabase = true,
InitializeAuditTable = true,
InitializationScript = "<POSTGRESQL_SCRIPT>",
Name = "<KEYED_IDENTIFIER>",
MaxPoolSize = 100,
MinPoolSize = 10,
CommandTimeoutSeconds = 30
}
},
EnableHealthChecks = true,
EnableIdempotency = true,
IdempotencyPolicy = new IdempotencyPolicy
{
ReplayableMethods = new List<string> { "POST", "PUT" },
ExpirationMinutes = 10,
IncludeQueryStringInKey = true,
MaximumResponseBodyBytes = 1024 * 1024 // 1 MB
},
EnableStorage = true,
StoragePolicies = new List<StoragePolicy>
{
new StoragePolicy
{
Name = "<KEYED_IDENTIFIER>",
StorageProvider = StorageProvider.Minio,
ConnectionStringName = "<MINIO_CONNECTION_STRING_ENVIRONMENT_VARIABLE_NAME>",
BucketName = "<BUCKET_NAME>"
},
new StoragePolicy
{
Name = "<KEYED_IDENTIFIER>",
StorageProvider = StorageProvider.AzureBlob,
ConnectionStringName = "<AZURE_BLOB_STORAGE_CONNECTION_STRING_ENVIRONMENT_VARIABLE_NAME>",
BucketName = "<BUCKET_NAME>"
},
new StoragePolicy
{
Name = "<KEYED_IDENTIFIER>",
StorageProvider = StorageProvider.S3,
ConnectionStringName = "<S3_STORAGE_CONNECTION_STRING_ENVIRONMENT_VARIABLE_NAME>",
BucketName = "<BUCKET_NAME>"
},
new StoragePolicy
{
Name = "<KEYED_IDENTIFIER>",
StorageProvider = StorageProvider.GoogleCloud,
ConnectionStringName = "<GCP_STORAGE_CONNECTION_STRING_ENVIRONMENT_VARIABLE_NAME>",
BucketName = "<BUCKET_NAME>"
}
},
EnableRateLimit = true,
RateLimitPolicies = new List<RateLimitPolicy>
{
new RateLimitPolicy
{
PolicyName = "<POLICY_NAME>",
Algorithm = RateLimitAlgorithm.FixedWindow,
Scope = RateLimitScope.IpAddress,
PermitLimit = 2,
Window = TimeSpan.FromSeconds(2)
}
},
EnableApiVersioning = true,
ApiVersioningPolicy = new ApiVersioningPolicy
{
DefaultMajorVersion = 1,
DefaultMinorVersion = 0,
AssumeDefaultVersionWhenUnspecified = true,
ReportApiVersions = true,
Readers = [
ApiVersionReaderType.QueryString,
ApiVersionReaderType.Header,
ApiVersionReaderType.UrlSegment,
ApiVersionReaderType.MediaType
],
QueryStringParameterName = "api-version",
HeaderNames = ["x-api-version"],
MediaTypeParameterName = "ver"
},
EnableSwagger = true,
SwaggerPolicy = new SwaggerPolicy
{
Title = "<API_TITLE>",
Description = "<API_DESCRIPTION>",
DocumentMode = SwaggerDocumentMode.PerApiVersion,
Documents = new List<SwaggerDocumentDefinition>
{
new SwaggerDocumentDefinition { DocumentName = "v1", ApiGroupName = "v1", Version = "1.0", Title = "<DOC_TITLE_V1>" },
new SwaggerDocumentDefinition { DocumentName = "v2", ApiGroupName = "v2", Version = "2.0", Title = "<DOC_TITLE_V2>" },
new SwaggerDocumentDefinition { DocumentName = "v3", ApiGroupName = "v3", Version = "3.0", Title = "<DOC_TITLE_V3>" }
}
},
EnableWebhookSignatureValidation = true,
WebhookSignaturePolicies = new List<WebhookSignaturePolicy>
{
new WebhookSignaturePolicy
{
Name = "<WEBHOOK_POLICY_NAME>",
PathPrefix = "<WEBHOOK_PATH_PREFIX>",
SecretName = "<WEBHOOK_SECRET_ENVIRONMENT_VARIABLE_NAME>",
Algorithm = RequestSignatureAlgorithm.HmacSha256,
AllowedClockSkewSeconds = 300
}
},
ConfigureAuthentication = true,
ConfigureAuthorization = true,
AuthManifest = new AuthManifest
{
EnableJwt = true,
EnableCookies = true,
EnableCsrfProtection = false,
EnableApiKeyAuth = true,
Policies = new List<AuthPolicy>
{
new AuthPolicy
{
PolicyName = "<AUTH_POLICY_NAME_1>",
RequiredRoles = new List<string> { "<ROLE_1>", "<ROLE_2>" }
},
new AuthPolicy
{
PolicyName = "<AUTH_POLICY_NAME_2>",
RequiredClaims = new Dictionary<string, string> { { "<CLAIM_KEY>", "<CLAIM_VALUE>" } }
}
}
},
LoggingConfiguration = new LoggingConfiguration
{
EnableLogging = true,
EnablePiiRedaction = true,
RedactedProperties = new List<string> { "Password", "Ssn", "Email" },
IgnoredRoutes = new List<string> { "/health", "/login" },
IgnoredLoggers = new List<string> { "SignalRHeartbeat" }
},
};
Note: Direct instantiation bypasses the Singleton enforcement and is not recommended for production use.
ApplicationConfiguration instance is consistent and shared across the application.The following section describes the main classes and their functions in each of the core folders:
DateTime (e.g., EnsureUtc, StartOfDayUtc, EndOfDayUtc, Unix time conversions, and range calculations).Parse, TryParse, GetNames, GetValues, IsDefined).dotnet add package AbsoluteAlgorithm.Core
Below is a sample configuration for ApplicationConfiguration demonstrating how to set up databases, storage, rate limiting, API versioning, Swagger, authentication, and more:
ApplicationConfiguration appConfig = new ApplicationConfigurationBuilder()
.WithDatabasePolicies(databasePolicies)
.WithStoragePolicies(storagePolicies)
.WithHttpClientPolicies(httpClientPolicies)
.WithApiVersioningPolicy(apiVersioningPolicy)
.WithSwaggerPolicy(swaggerPolicy)
.WithIdempotencyPolicy(idempotencyPolicy)
.WithCachingPolicy(cachingPolicy)
.WithAuthManifest(authManifest)
.WithWebhookSignaturePolicies(webhookPolicies)
.WithRateLimitPolicies(rateLimitPolicies)
.EnableHealthChecks(true)
.Build();
This project is licensed under the terms of the license specified in the file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on AbsoluteAlgorithm.Core:
| Package | Downloads |
|---|---|
|
AbsoluteAlgorithm.Infrastructure
Reusable ASP.NET Core Web API foundation library for AbsoluteAlgorithm services. Includes keyed Dapper repositories, storage providers, authentication, API versioning, NSwag, and resilience utilities. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.4 | 112 | 5/18/2026 |
| 1.0.3 | 126 | 4/14/2026 |
| 1.0.1-beta.15 | 64 | 4/14/2026 |
| 1.0.1-beta.14 | 65 | 4/12/2026 |
| 1.0.1-beta.13 | 57 | 4/12/2026 |
| 1.0.0-beta.12 | 66 | 4/4/2026 |
| 1.0.0-beta.11 | 64 | 4/4/2026 |
| 1.0.0-beta.9 | 77 | 3/29/2026 |
See CHANGELOG.md for details.