Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V9.0.0/net9rc1 housekeeping #82

Merged
merged 37 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
02132b7
:thread: change applied after looking in sourcecode for Start extensi…
gimlichael Sep 13, 2024
c0d7b4f
:art: sqllitedb housekeeping
gimlichael Sep 14, 2024
b4619b3
:boom: removed BulkCopyDataReader
gimlichael Sep 14, 2024
20ad861
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
7db0558
:boom: removed NewLine constant from Alphanumeric as it could cause c…
gimlichael Sep 14, 2024
86e3a39
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
e22eef7
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
974fd6b
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
7de8852
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
63c44c9
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
ceeff26
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
bc0431e
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
06383c7
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
4cb0396
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
c55734a
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
7aa665e
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
c6a8466
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
2d7599f
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
db8499d
:rotating_light: ca2022
gimlichael Sep 14, 2024
c38ce47
:rotating_light: ca2022
gimlichael Sep 14, 2024
018c691
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
b6abe0a
:rotating_light: abundant exclusions primarly due to lack of support …
gimlichael Sep 14, 2024
4f35a83
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
d2abe9c
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
9d03aca
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
1546f12
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
e8ba633
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
9594bd9
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
65b1521
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
ff21403
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
33536e0
:rotating_light: consious exclusions
gimlichael Sep 14, 2024
9f711cd
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
261bf44
:alembic: consequence changes of 9f711cdda99
gimlichael Sep 14, 2024
2a17ebb
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
6ca2530
:rotating_light: https://learn.microsoft.com/en-us/dotnet/fundamental…
gimlichael Sep 14, 2024
43d87b7
:rotating_light: https://sonarcloud.io/organizations/geekle/rules?ope…
gimlichael Sep 14, 2024
c3dba38
:rotating_light: ignore IDE0330 while supported TFMs are less than ne…
gimlichael Sep 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,73 @@ dotnet_diagnostic.IDE0046.severity = none
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048
[*.{cs,vb}]
dotnet_diagnostic.IDE0047.severity = none

# CA1716: Identifiers should not match keywords
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1716
[*.{cs,vb}]
dotnet_diagnostic.CA1716.severity = none

# CA1720: Identifiers should not contain type names
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1720
[*.{cs,vb}]
dotnet_diagnostic.CA1720.severity = none

# CA1846: Prefer AsSpan over Substring
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1846
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA1846.severity = none

# CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1847
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA1847.severity = none

# CA1865-CA1867: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1865-ca1867
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA1865.severity = none
dotnet_diagnostic.CA1866.severity = none
dotnet_diagnostic.CA1867.severity = none

# CA2263: Prefer generic overload when type is known
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2263
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA2263.severity = none

# CA2249: Consider using String.Contains instead of String.IndexOf
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2249
# Excluded while TFMs include netstandard2.0
[*.{cs,vb}]
dotnet_diagnostic.CA2249.severity = none

# IDE0022: Use expression body for methods
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022
[*.{cs,vb}]
dotnet_diagnostic.IDE0022.severity = none

# IDE0032: Use auto-property
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0032
[*.{cs,vb}]
dotnet_diagnostic.IDE0032.severity = none

# Order modifiers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036
# Excluded becuase of inconsistency with other analyzers
[*.{cs,vb}]
dotnet_diagnostic.IDE0036.severity = none

# Order modifiers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036
# Excluded becuase of inconsistency with other analyzers
[*.{cs,vb}]
dotnet_diagnostic.IDE0036.severity = none

# Use 'System.Threading.Lock'
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0330
# Excluded while TFMs are less than net9.0
[*.{cs,vb}]
dotnet_diagnostic.IDE0330.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected AuthorizationHeader(string authenticationScheme)
public virtual AuthorizationHeader Parse(string authorizationHeader, Action<AuthorizationHeaderOptions> setup)
{
Validator.ThrowIfNullOrWhitespace(authorizationHeader);
Validator.ThrowIfFalse(() => authorizationHeader.StartsWith(AuthenticationScheme), nameof(authorizationHeader), $"Header did not start with {AuthenticationScheme}.");
Validator.ThrowIfFalse(() => authorizationHeader.StartsWith(AuthenticationScheme, StringComparison.OrdinalIgnoreCase), nameof(authorizationHeader), $"Header did not start with {AuthenticationScheme}.");
Validator.ThrowIfInvalidConfigurator(setup, out var options);

var headerWithoutScheme = authorizationHeader.Remove(0, AuthenticationScheme.Length + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public ImmutableDictionary<string, string> ToImmutableDictionary()
/// <returns>A <see cref="string" /> that represents this instance.</returns>
public override string ToString()
{
return DelimitedString.Create(Data.Keys.Select(key => $"{key}={Data[key]}"), o => o.Delimiter = Alphanumeric.NewLine + Alphanumeric.NewLine);
return DelimitedString.Create(Data.Keys.Select(key => $"{key}={Data[key]}"), o => o.Delimiter = Environment.NewLine + Environment.NewLine);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static BasicAuthorizationHeader Create(string authorizationHeader)
/// </summary>
public const string Scheme = HttpAuthenticationSchemes.Basic;

BasicAuthorizationHeader() : base(Scheme)
private BasicAuthorizationHeader() : base(Scheme)
{
}

Expand Down Expand Up @@ -96,7 +96,7 @@ public override string ToString()
public override AuthorizationHeader Parse(string authorizationHeader, Action<AuthorizationHeaderOptions> setup)
{
Validator.ThrowIfNullOrWhitespace(authorizationHeader);
Validator.ThrowIfFalse(() => authorizationHeader.StartsWith(AuthenticationScheme), nameof(authorizationHeader), $"Header did not start with {AuthenticationScheme}.");
Validator.ThrowIfFalse(() => authorizationHeader.StartsWith(AuthenticationScheme, StringComparison.OrdinalIgnoreCase), nameof(authorizationHeader), $"Header did not start with {AuthenticationScheme}.");

var headerWithoutScheme = authorizationHeader.Remove(0, AuthenticationScheme.Length + 1);
var credentials = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ await Decorator.Enclose(context).InvokeUnauthorizedExceptionAsync(Options, princ
internal static bool TryAuthenticate(HttpContext context, DigestAuthorizationHeader header, out ConditionalValue<ClaimsPrincipal> result)
{
var options = context.Items[nameof(DigestAuthenticationOptions)] as DigestAuthenticationOptions;
var nonceTracker = context.Items[nameof(INonceTracker)] as INonceTracker;
if (options?.Authenticator == null)
{
result = new UnsuccessfulValue<ClaimsPrincipal>(new SecurityException($"{nameof(options.Authenticator)} was unexpectedly set to null."));
Expand All @@ -94,7 +93,7 @@ internal static bool TryAuthenticate(HttpContext context, DigestAuthorizationHea
return false;
}

if (nonceTracker != null)
if (context.Items[nameof(INonceTracker)] is INonceTracker nonceTracker)
{
var nc = Convert.ToInt32(header.NC, 16);
if (nonceTracker.TryGetEntry(header.Nonce, out var previousNonce))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Cuemon.Net.Http;

Expand Down Expand Up @@ -34,7 +35,7 @@ public static DigestAuthorizationHeader Create(string authorizationHeader)
/// </summary>
public const string Scheme = HttpAuthenticationSchemes.Digest;

DigestAuthorizationHeader() : base(Scheme)
private DigestAuthorizationHeader() : base(Scheme)
{
}

Expand Down Expand Up @@ -177,7 +178,7 @@ public override string ToString()

private static void AppendField(StringBuilder sb, string fn, string fv)
{
if (!string.IsNullOrWhiteSpace(fv)) { sb.Append($" {fn}=\"{fv}\""); }
if (!string.IsNullOrWhiteSpace(fv)) { sb.Append(CultureInfo.InvariantCulture, $" {fn}=\"{fv}\""); }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public DigestAuthorizationHeaderBuilder AddUri(string digestUri)
public DigestAuthorizationHeaderBuilder AddNc(int nonceCount)
{
Validator.ThrowIfLowerThan(nonceCount, 0, nameof(nonceCount));
return AddOrUpdate(DigestFields.NonceCount, nonceCount.ToString("x8"));
return AddOrUpdate(DigestFields.NonceCount, nonceCount.ToString("x8", CultureInfo.InvariantCulture));
}

/// <summary>
Expand Down Expand Up @@ -139,7 +139,7 @@ public DigestAuthorizationHeaderBuilder AddFromWwwAuthenticateHeader(IHeaderDict
private DigestAuthorizationHeaderBuilder AddFromWwwAuthenticateHeader(string wwwAuthenticateHeader)
{
Validator.ThrowIfNull(wwwAuthenticateHeader);
Validator.ThrowIfFalse(() => wwwAuthenticateHeader.StartsWith(AuthenticationScheme), nameof(wwwAuthenticateHeader), $"Header did not start with {AuthenticationScheme}.");
Validator.ThrowIfFalse(() => wwwAuthenticateHeader.StartsWith(AuthenticationScheme, StringComparison.OrdinalIgnoreCase), nameof(wwwAuthenticateHeader), $"Header did not start with {AuthenticationScheme}.");
var headerWithoutScheme = wwwAuthenticateHeader.Remove(0, AuthenticationScheme.Length + 1);
var fields = DelimitedString.Split(headerWithoutScheme);
foreach (var field in fields)
Expand Down Expand Up @@ -270,4 +270,4 @@ public override DigestAuthorizationHeader Build()
Data[DigestFields.Response]);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static HmacAuthorizationHeader Create(string authenticationScheme, string
return new HmacAuthorizationHeader(authenticationScheme).Parse(authorizationHeader, setup) as HmacAuthorizationHeader;
}

HmacAuthorizationHeader(string authenticationScheme) : base(authenticationScheme)
private HmacAuthorizationHeader(string authenticationScheme) : base(authenticationScheme)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public override string ComputeSignature()
Decorator.Enclose(Data).GetValueOrDefault(HmacFields.CredentialScope),
Alphanumeric.Linefeed,
ComputeCanonicalRequest());
var date = DateTime.Parse(Data[HmacFields.ServerDateTime], CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).Date.ToString("yyyyMMdd");
var date = DateTime.Parse(Data[HmacFields.ServerDateTime], CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).Date.ToString("yyyyMMdd", CultureInfo.InvariantCulture);
var dateSecret = KeyedHashFactory.CreateHmacCrypto(secret, HmacAlgorithm).ComputeHash(date).GetBytes();

AddOrUpdate(HmacFields.StringToSign, stringToSign);
Expand Down
4 changes: 2 additions & 2 deletions src/Cuemon.AspNetCore.Mvc/ContentBasedObjectResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ internal ContentBasedObjectResult(object instance, byte[] checksum, bool isWeak
public HashResult Checksum { get; }
}

internal class ContentBasedObjectResult<T> : ContentBasedObjectResult
internal sealed class ContentBasedObjectResult<T> : ContentBasedObjectResult
{
internal ContentBasedObjectResult(T instance, byte[] checksum, bool isWeak = false) : base(instance, checksum, isWeak)
{
}
}
}
}
4 changes: 2 additions & 2 deletions src/Cuemon.AspNetCore.Mvc/ContentTimeBasedObjectResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ internal ContentTimeBasedObjectResult(object instance, IEntityDataTimestamp time
public HashResult Checksum { get; set; }
}

internal class ContentTimeBasedObjectResult<T> : ContentTimeBasedObjectResult
internal sealed class ContentTimeBasedObjectResult<T> : ContentTimeBasedObjectResult
{
internal ContentTimeBasedObjectResult(T instance, IEntityDataTimestamp timestamp, IEntityDataIntegrity dataIntegrity) : base(instance, timestamp, dataIntegrity)
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ServerTimingAttribute()
/// Gets or sets the value that in combination with <see cref="ThresholdTimeUnit" /> specifies the threshold of the action method.
/// </summary>
/// <value>The threshold value of the action method.</value>
public double Threshold { get; set; } = 0;
public double Threshold { get; set; }

/// <summary>
/// Gets or sets one of the enumeration values that specifies the time unit of <see cref="Threshold"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public override void OnActionExecuted(ActionExecutedContext context)
var logLevel = Options.LogLevelSelector(metric);
Logger.Log(logLevel, "ServerTimingMetric {{ Name: {Name}, Duration: {Duration}ms, Description: \"{Description}\" }}",
metric.Name,
metric.Duration?.TotalMilliseconds.ToString("F1", CultureInfo.InvariantCulture) ?? 0.ToString("F1"),
metric.Duration?.TotalMilliseconds.ToString("F1", CultureInfo.InvariantCulture) ?? 0.ToString("F1", CultureInfo.InvariantCulture),
metric.Description ?? "N/A");
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Cuemon.AspNetCore.Mvc/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
[assembly: SuppressMessage("Major Code Smell", "S1066:Collapsible \"if\" statements should be merged", Justification = "By design; easier for debug purposes and with clear scope.", Scope = "member", Target = "~M:Cuemon.AspNetCore.Mvc.Filters.Cacheable.HttpEntityTagHeaderFilter.OnResultExecutionAsync(Microsoft.AspNetCore.Mvc.Filters.ResultExecutingContext,Microsoft.AspNetCore.Mvc.Filters.ResultExecutionDelegate)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Critical Code Smell", "S3776:Cognitive Complexity of methods should not be too high", Justification = "If i invert the if-statement, the warning goes away - but the code becomes harder to read. So for now, i exclude it as 'by design'.", Scope = "member", Target = "~M:Cuemon.AspNetCore.Mvc.Filters.Diagnostics.FaultDescriptorFilter.OnException(Microsoft.AspNetCore.Mvc.Filters.ExceptionContext)")]
[assembly: SuppressMessage("Minor Code Smell", "S3236:Caller information arguments should not be provided explicitly", Justification = "Intentional.", Scope = "member", Target = "~M:Cuemon.AspNetCore.Mvc.Filters.Diagnostics.FaultDescriptorFilter.#ctor(Microsoft.Extensions.Options.IOptions{Cuemon.AspNetCore.Mvc.Filters.Diagnostics.MvcFaultDescriptorOptions})")]
[assembly: SuppressMessage("Performance", "CA1848:Use the LoggerMessage delegates", Justification = "Lack support for dynamic log-level.", Scope = "member", Target = "~M:Cuemon.AspNetCore.Mvc.Filters.Diagnostics.ServerTimingFilter.OnActionExecuted(Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext)")]
4 changes: 2 additions & 2 deletions src/Cuemon.AspNetCore.Mvc/TimeBasedObjectResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ internal TimeBasedObjectResult(object instance, DateTime created, DateTime? modi
public DateTime? Modified { get; }
}

internal class TimeBasedObjectResult<T> : TimeBasedObjectResult
internal sealed class TimeBasedObjectResult<T> : TimeBasedObjectResult
{
internal TimeBasedObjectResult(T instance, DateTime created, DateTime? modified) : base(instance, created, modified)
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override Task InvokeAsync(HttpContext context, ILogger<ServerTimingMiddle
var logLevel = options.LogLevelSelector(metric);
logger.Log(logLevel, "ServerTimingMetric {{ Name: {Name}, Duration: {Duration}ms, Description: \"{Description}\" }}",
metric.Name,
metric.Duration?.TotalMilliseconds.ToString("F1", CultureInfo.InvariantCulture) ?? 0.ToString("F1"),
metric.Duration?.TotalMilliseconds.ToString("F1", CultureInfo.InvariantCulture) ?? 0.ToString("F1", CultureInfo.InvariantCulture),
metric.Description ?? "N/A");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static bool IsClientSideResourceCached(this IDecorator<HttpRequest> decor
clientSideEntityTag = clientSideEntityTag.Remove(indexOfEndQuote, 1);
clientSideEntityTag = clientSideEntityTag.Remove(indexOfStartQuote, 1);
}
return builder.Checksum.ToHexadecimalString().Equals(clientSideEntityTag);
return builder.Checksum.ToHexadecimalString().Equals(clientSideEntityTag, StringComparison.Ordinal);
}
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Cuemon.AspNetCore/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[assembly: SuppressMessage("Style", "IDE0130:Namespace does not match folder structure", Justification = "Intentional as these embark on IDecorator.", Scope = "namespace", Target = "~N:Cuemon.AspNetCore.Diagnostics")]
[assembly: SuppressMessage("Style", "IDE0130:Namespace does not match folder structure", Justification = "Intentional as these embark on IDecorator.", Scope = "namespace", Target = "~N:Cuemon.AspNetCore.Http")]
[assembly: SuppressMessage("Style", "IDE0130:Namespace does not match folder structure", Justification = "Intentional as these embark on IDecorator.", Scope = "namespace", Target = "~N:Cuemon.AspNetCore.Http.Headers")]
[assembly: SuppressMessage("Globalization", "CA1304:Specify CultureInfo", Justification = "Not relevant in this context.", Scope = "member", Target = "~P:Cuemon.AspNetCore.Configuration.DynamicCacheBusting.Version")]
[assembly: SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix", Justification = "Suffix left out for clarity on intent.", Scope = "type", Target = "~T:Cuemon.AspNetCore.Http.Throttling.IThrottlingCache")]
[assembly: SuppressMessage("Performance", "CA1848:Use the LoggerMessage delegates", Justification = "Lack support for dynamic log-level.", Scope = "member", Target = "~M:Cuemon.AspNetCore.Diagnostics.ServerTimingMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext,Microsoft.Extensions.Logging.ILogger{Cuemon.AspNetCore.Diagnostics.ServerTimingMiddleware},Microsoft.Extensions.Hosting.IHostEnvironment,Cuemon.AspNetCore.Diagnostics.IServerTiming,Microsoft.Extensions.Options.IOptions{Cuemon.AspNetCore.Diagnostics.ServerTimingOptions})~System.Threading.Tasks.Task")]
2 changes: 1 addition & 1 deletion src/Cuemon.AspNetCore/Http/HttpStatusCodeException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public override string ToString()
foreach (var pi in this.GetType().GetProperties().Where(pi => pi.CanRead && Decorator.Enclose(pi.DeclaringType).HasTypes(typeof(HttpStatusCodeException))))
{
var value = Patterns.InvokeOrDefault(() => pi.GetValue(this, null)); // we cannot risk exceptions being thrown in a ToString method
if (value != null) { sb.AppendLine($"{Alphanumeric.Tab}{pi.Name}: {value}"); }
if (value != null) { sb.AppendLine(CultureInfo.InvariantCulture, $"{Alphanumeric.Tab}{pi.Name}: {value}"); }
}
return sb.ToString();
}
Expand Down
7 changes: 1 addition & 6 deletions src/Cuemon.Core/Alphanumeric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,10 @@ public static class Alphanumeric
public const string Hexadecimal = Numbers + "ABCDEF";

/// <summary>
/// A network-path reference, eg. two forward slashes (//).
/// A network-path reference, e.g. two forward slashes (//).
/// </summary>
public const string NetworkPathReference = "//";

/// <summary>
/// Carriage-return/linefeed character combination.
/// </summary>
public const string NewLine = CarriageReturn + Linefeed;

/// <summary>
/// Tab character.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Cuemon.Core/BitStorageCapacity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static BitStorageCapacity FromBits(double bits, Action<StorageCapacityOpt
/// </summary>
/// <param name="unit">The <see cref="BitUnit"/> to convert.</param>
/// <param name="setup">The <see cref="StorageCapacityOptions"/> which may be configured.</param>
BitStorageCapacity(BitUnit unit, Action<StorageCapacityOptions> setup = null) : base(unit, setup)
private BitStorageCapacity(BitUnit unit, Action<StorageCapacityOptions> setup = null) : base(unit, setup)
{
}
}
}
}
4 changes: 2 additions & 2 deletions src/Cuemon.Core/ByteStorageCapacity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static ByteStorageCapacity FromBytes(double bytes, Action<StorageCapacity
/// </summary>
/// <param name="unit">The <see cref="ByteUnit"/> to convert.</param>
/// <param name="setup">The <see cref="StorageCapacityOptions"/> which may be configured.</param>
ByteStorageCapacity(ByteUnit unit, Action<StorageCapacityOptions> setup = null) : base(unit, setup)
private ByteStorageCapacity(ByteUnit unit, Action<StorageCapacityOptions> setup = null) : base(unit, setup)
{
}
}
}
}
Loading
Loading