fix: type cache reset when metadata updates occure
All checks were successful
default / dotnet-default-workflow (pull_request) Successful in 3m28s
default / dotnet-default-workflow (push) Successful in 2m10s

This commit is contained in:
Louis Seubert 2026-05-28 20:39:51 +02:00
commit 21b6f04f8c
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
3 changed files with 14 additions and 0 deletions

View file

@ -23,6 +23,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Changed
- **request.dispatcher:** Reset type caches when reloading assemblies
- **request.validation:** Reset type caches when reloading assemblies
### Removed
[1.0.0]: https://code.geekeey.de/geekeey/request/releases/tag/1.0.0

View file

@ -20,6 +20,12 @@ internal sealed class RequestDispatcher : IRequestDispatcher
_serviceProvider = serviceProvider;
}
public static void ClearCache(Type[]? _)
{
ScalarRequestHandlers.Clear();
StreamRequestHandlers.Clear();
}
public Task<TResponse> DispatchAsync<TResponse>(IScalarRequest<TResponse> request, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(request);

View file

@ -22,6 +22,11 @@ internal sealed class DispatchingValidator : IValidator
_serviceProvider = serviceProvider;
}
public static void ClearCache(Type[]? _)
{
ValidatorsHandlers.Clear();
}
public Validation Validate(ValidationContext context)
{
ArgumentNullException.ThrowIfNull(context);