From 6de1dbb90b052fcac63643b33637491b359ca3a3 Mon Sep 17 00:00:00 2001 From: Tim M <49349513+TimothyMakkison@users.noreply.github.com> Date: Sat, 26 Oct 2024 03:00:43 +0100 Subject: [PATCH] feat: change `IPerformanceService` to return `HttpResponseMessage` (#1893) --- Refit.Benchmarks/IPerformanceService.cs | 10 +++++----- Refit.Benchmarks/PerformanceBenchmark.cs | 10 +++++----- Refit.Benchmarks/StartupBenchmark.cs | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Refit.Benchmarks/IPerformanceService.cs b/Refit.Benchmarks/IPerformanceService.cs index 36b7036a8..d01358d45 100644 --- a/Refit.Benchmarks/IPerformanceService.cs +++ b/Refit.Benchmarks/IPerformanceService.cs @@ -3,20 +3,20 @@ public interface IPerformanceService { [Get("/users")] - public Task ConstantRoute(); + public Task ConstantRoute(); [Get("/users/{id}")] - public Task DynamicRoute(int id); + public Task DynamicRoute(int id); [Get("/users/{id}/{user}/{status}")] - public Task ComplexDynamicRoute(int id, string user, string status); + public Task ComplexDynamicRoute(int id, string user, string status); [Get("/users/{request.someProperty}")] - public Task ObjectRequest(PathBoundObject request); + public Task ObjectRequest(PathBoundObject request); [Post("/users/{id}/{request.someProperty}")] [Headers("User-Agent: Awesome Octocat App", "X-Emoji: :smile_cat:")] - public Task ComplexRequest(int id, PathBoundObject request, [Query(CollectionFormat.Multi)]int[] queries); + public Task ComplexRequest(int id, PathBoundObject request, [Query(CollectionFormat.Multi)]int[] queries); } public class PathBoundObject diff --git a/Refit.Benchmarks/PerformanceBenchmark.cs b/Refit.Benchmarks/PerformanceBenchmark.cs index d34d912bb..8a1b09678 100644 --- a/Refit.Benchmarks/PerformanceBenchmark.cs +++ b/Refit.Benchmarks/PerformanceBenchmark.cs @@ -32,17 +32,17 @@ public Task SetupAsync() } [Benchmark] - public async Task ConstantRouteAsync() => await service.ConstantRoute(); + public async Task ConstantRouteAsync() => await service.ConstantRoute(); [Benchmark] - public async Task DynamicRouteAsync() => await service.DynamicRoute(101); + public async Task DynamicRouteAsync() => await service.DynamicRoute(101); [Benchmark] - public async Task ComplexDynamicRouteAsync() => await service.ComplexDynamicRoute(101, "tom", "yCxv"); + public async Task ComplexDynamicRouteAsync() => await service.ComplexDynamicRoute(101, "tom", "yCxv"); [Benchmark] - public async Task ObjectRequestAsync() => await service.ObjectRequest(new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"}); + public async Task ObjectRequestAsync() => await service.ObjectRequest(new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"}); [Benchmark] - public async Task ComplexRequestAsync() => await service.ComplexRequest(101, new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"}, [1,2,3,4,5,6]); + public async Task ComplexRequestAsync() => await service.ComplexRequest(101, new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"}, [1,2,3,4,5,6]); } diff --git a/Refit.Benchmarks/StartupBenchmark.cs b/Refit.Benchmarks/StartupBenchmark.cs index babd94bb2..e1e2fdee4 100644 --- a/Refit.Benchmarks/StartupBenchmark.cs +++ b/Refit.Benchmarks/StartupBenchmark.cs @@ -28,20 +28,20 @@ public void Setup() public IPerformanceService CreateService() => RestService.For(Host, settings); [Benchmark] - public async Task FirstCallConstantRouteAsync() => await initialisedService.ConstantRoute(); + public async Task FirstCallConstantRouteAsync() => await initialisedService.ConstantRoute(); [Benchmark] - public async Task ConstantRouteAsync() + public async Task ConstantRouteAsync() { var service = RestService.For(Host, settings); return await service.ConstantRoute(); } [Benchmark] - public async Task FirstCallComplexRequestAsync() => await initialisedService.ObjectRequest(new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"}); + public async Task FirstCallComplexRequestAsync() => await initialisedService.ObjectRequest(new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"}); [Benchmark] - public async Task ComplexRequestAsync() + public async Task ComplexRequestAsync() { var service = RestService.For(Host, settings); return await service.ObjectRequest(new PathBoundObject(){SomeProperty = "myProperty", SomeQuery = "myQuery"});