Lombiq Helpful Libraries - ASP.NET Core Libraries - Extensions
December 4, 2024 ยท View on GitHub
ConfigurationSectionExtensions: Provides shortcuts forIConfigurationSectionoperations.CookieHttpContextExtensions: Provides shortcuts for some cookie-related operations.DateTimeHttpContextExtensions: Makes it possible to set or get IANA time-zone IDs in the HTTP context.EnvironmentHttpContextExtensions: Provides shortcuts to determine information about the current hosting environment, like whether the app is running in Development mode.ForwardedHeadersApplicationBuilderExtensions: ProvidesUseForwardedHeadersForCloudflareAndAzure()that forwards proxied headers onto the current request with settings suitable for an app behind Cloudflare and hosted in an Azure App Service.HttpContentExtensions: Extensions forHttpContenttypes, which are used as message body when sending requests viaHttpClient.JsonStringExtensions: Adds JSON related extensions for thestringtype. For example,JsonHtmlContentsafely serializes a string for use in<script>elements.NonEmptyTagHelper: An attribute tag helper that conditionally hides its element if the provided collection is null or empty. This eliminates a bulky wrapping@if(collection?.Count > 1) { ... }expression that would needlessly increase the document's indentation too.TemporaryResponseWrapper: AnIAsyncDisposablethat replaces theHttpContext's response stream at creation with aMemoryStreamand copies its content back into the real response stream during disposal.