diff --git a/src/Kiota.Builder/Refiners/CSharpRefiner.cs b/src/Kiota.Builder/Refiners/CSharpRefiner.cs index f618db0898..5e36de1890 100644 --- a/src/Kiota.Builder/Refiners/CSharpRefiner.cs +++ b/src/Kiota.Builder/Refiners/CSharpRefiner.cs @@ -221,6 +221,10 @@ protected static void CorrectMethodType(CodeMethod currentMethod) .Select(x => x.Type) .Union(new[] { currentMethod.ReturnType }) .ToArray()); + CorrectCoreTypes(currentMethod.Parent as CodeClass, DateTypesReplacements, currentMethod.PathQueryAndHeaderParameters + .Select(x => x.Type) + .Union(new[] { currentMethod.ReturnType }) + .ToArray()); } private static readonly Dictionary DateTypesReplacements = new(StringComparer.OrdinalIgnoreCase)