diff --git a/src/IdempotentAPI/Core/Idempotency.cs b/src/IdempotentAPI/Core/Idempotency.cs index e26c746..569f254 100644 --- a/src/IdempotentAPI/Core/Idempotency.cs +++ b/src/IdempotentAPI/Core/Idempotency.cs @@ -193,7 +193,9 @@ and not HttpContext and not HttpResponse and not ClaimsPrincipal and not CancellationToken) - && (_excludeRequestSpecialTypes is null || (_excludeRequestSpecialTypes is not null && !_excludeRequestSpecialTypes.Contains(a.GetType()))) + && (_excludeRequestSpecialTypes is null || + (_excludeRequestSpecialTypes is not null && + !_excludeRequestSpecialTypes.Any(t => a.GetType() == t || a.GetType().IsSubclassOf(t)))) ).ToList(); string requestsDataHash = await GenerateRequestsDataHashMinimalApiAsync(filteredArguments, httpContext.Request); diff --git a/src/IdempotentAPI/Extensions/DependencyInjection/IdempotentAPIExtensions.cs b/src/IdempotentAPI/Extensions/DependencyInjection/IdempotentAPIExtensions.cs index a7ad418..e1a5030 100644 --- a/src/IdempotentAPI/Extensions/DependencyInjection/IdempotentAPIExtensions.cs +++ b/src/IdempotentAPI/Extensions/DependencyInjection/IdempotentAPIExtensions.cs @@ -59,7 +59,9 @@ public static IServiceCollection AddIdempotentMinimalAPI(this IServiceCollection TimeSpan.FromMilliseconds(idempotencyOptions.DistributedLockTimeoutMilli), idempotencyOptions.CacheOnlySuccessResponses, idempotencyOptions.IsIdempotencyOptional, - idempotencyOptions.SerializerSettings); + idempotencyOptions.SerializerSettings, + idempotencyOptions.ExcludeRequestSpecialTypes + ); }); return serviceCollection;