Repository navigation
v4.0.0
4.0 changes default behavior in CSharpEssentials.AspNetCore, CSharpEssentials.EntityFrameworkCore and CSharpEssentials.Resilience. Each old behavior can be turned back on with a setting. Read Migrating from 3.x to 4.0 before upgrading.
Added
- Enum query and route binding for Minimal API and MVC:
services.AddEnumBinding()andapp.UseEnumBinding(). IExceptionProblemMapper,IErrorStatusCodeMapperandIProblemDetailsEnricherextension points for ProblemDetails.services.ConfigureInvalidModelStateResponse()writes the automatic[ApiController]400 as an enhanced problem.ConditionalStringEnumConverter.AllowUndefinedValues.RetryIfFailedoverloads with aFunc<Error, bool> shouldRetrypredicate.SecretManagerConfigurationOptions.LoggerFactoryfor GCP Secret Manager logging.- Analyzer CSE0001 for
[StringEnum]enums nested in a class or struct.
Changed
- ProblemDetails output: W3C trace id, fewer request fields by default, RFC 9110
typeURIs, validation-onlyerrors, exception messages hidden in 500 responses.o.UseLegacyDefaults()restores the 3.x fields. - Minimal API, MVC,
GlobalExceptionHandlerand status code pages all write ProblemDetails throughIProblemDetailsService. ResultEndpointFilterreturns ProblemDetails instead of a rawError[].StringEnumNamingis the single enum naming source for JSON, EF Core, Swagger and binding.UseLegacySnakeCaserestores the 3.x EF Core spelling.- The non-generic
ResiliencePolicyretries failedResultvalues, and caller cancellation throwsOperationCanceledException. CSharpEssentials.Resiliencedepends onPolly.Coreinstead ofPolly.CSharpEssentials.GcpSecretManagerdepends onCSharpEssentials.Resilience.Swashbuckle.AspNetCoreis bounded to[8.1.0, 10), andCSharpEssentials.EntityFrameworkCorepins each target framework to its own EF Core major.SecretManagerConfigurationOptionsis asealed record(binary-breaking forAddProject).
Fixed
PolymorphicJsonConverterFactoryno longer wraps collection and dictionary interfaces in a$typeenvelope.JsonOptions.ApplyTokeeps the target'sTypeInfoResolver.- GCP Secret Manager retries listing and secret access on transient errors, and loads secrets without a shared mutable dictionary.
AddValidatorandAddValidatorsFromAssemblyno longer register the same validator twice.default(ResiliencePolicy)behaves likeCreate().