diff --git a/perf/BenchmarkApp/PerformanceTest.Client/Program.cs b/perf/BenchmarkApp/PerformanceTest.Client/Program.cs index 284ce3c6e..c946bb662 100644 --- a/perf/BenchmarkApp/PerformanceTest.Client/Program.cs +++ b/perf/BenchmarkApp/PerformanceTest.Client/Program.cs @@ -52,7 +52,7 @@ async Task Main( // Create a control channel using var channelControl = GrpcChannel.ForAddress(config.Url); var controlServiceClient = MagicOnionClient.Create(channelControl); - controlServiceClient.SetMemoryProfilerCollectAllocations(true); + await controlServiceClient.SetMemoryProfilerCollectAllocationsAsync(true); ServerInformation serverInfo; WriteLog("Gathering the server information..."); diff --git a/perf/BenchmarkApp/PerformanceTest.Server/PerfTestControlService.cs b/perf/BenchmarkApp/PerformanceTest.Server/PerfTestControlService.cs index d8d62d59b..004b66d3c 100644 --- a/perf/BenchmarkApp/PerformanceTest.Server/PerfTestControlService.cs +++ b/perf/BenchmarkApp/PerformanceTest.Server/PerfTestControlService.cs @@ -25,7 +25,7 @@ public UnaryResult GetServerInformationAsync() ApplicationInformation.Current.IsAttached)); } - public UnaryResult SetMemoryProfilerCollectAllocations(bool enable) + public UnaryResult SetMemoryProfilerCollectAllocationsAsync(bool enable) { MemoryProfiler.CollectAllocations(enable); return UnaryResult.CompletedResult; diff --git a/perf/BenchmarkApp/PerformanceTest.Shared/IPerfTestControlService.cs b/perf/BenchmarkApp/PerformanceTest.Shared/IPerfTestControlService.cs index e747c92e4..e4d621fed 100644 --- a/perf/BenchmarkApp/PerformanceTest.Shared/IPerfTestControlService.cs +++ b/perf/BenchmarkApp/PerformanceTest.Shared/IPerfTestControlService.cs @@ -9,7 +9,7 @@ public interface IPerfTestControlService : IService { UnaryResult GetServerInformationAsync(); - UnaryResult SetMemoryProfilerCollectAllocations(bool enable); + UnaryResult SetMemoryProfilerCollectAllocationsAsync(bool enable); UnaryResult CreateMemoryProfilerSnapshotAsync(string name); } diff --git a/perf/Microbenchmark/Microbenchmark.Client/HubMethodBenchmarks.cs b/perf/Microbenchmark/Microbenchmark.Client/HubMethodBenchmarks.cs index 813fe80e6..f4eaeaf88 100644 --- a/perf/Microbenchmark/Microbenchmark.Client/HubMethodBenchmarks.cs +++ b/perf/Microbenchmark/Microbenchmark.Client/HubMethodBenchmarks.cs @@ -44,9 +44,10 @@ public HubMethodBenchmarks() } [Benchmark] - public async Task Void_Parameter_Zero_NoReturn() + public Task Void_Parameter_Zero_NoReturn() { client.Void_Parameter_Zero_NoReturn(); + return Task.CompletedTask; } [Benchmark] diff --git a/samples/ChatApp/ChatApp.Console/Program.cs b/samples/ChatApp/ChatApp.Console/Program.cs index 8bba8d700..71c1c4429 100644 --- a/samples/ChatApp/ChatApp.Console/Program.cs +++ b/samples/ChatApp/ChatApp.Console/Program.cs @@ -51,6 +51,7 @@ public void OnSendMessage(MessageResponse message) public async Task HelloAsync(string name, int age) { Console.WriteLine("HelloAsync called"); + await Task.Delay(100); return $"Hello {name} ({age})!; {sessionId}"; } } diff --git a/src/MagicOnion.Server.HttpGateway/Swagger/SwaggerDefinitionBuilder.cs b/src/MagicOnion.Server.HttpGateway/Swagger/SwaggerDefinitionBuilder.cs index 2b848129f..8744aeff2 100644 --- a/src/MagicOnion.Server.HttpGateway/Swagger/SwaggerDefinitionBuilder.cs +++ b/src/MagicOnion.Server.HttpGateway/Swagger/SwaggerDefinitionBuilder.cs @@ -166,7 +166,9 @@ Schemas.Parameter[] BuildParameters(IDictionary definitions, Xml { BuildSchema(definitions, x.ParameterType); refSchema = new Schema { @ref = BuildSchema(definitions, x.ParameterType) }; +#pragma warning disable SYSLIB0050 var unknownObj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject(x.ParameterType); +#pragma warning restore SYSLIB0050 defaultObjectExample = JsonConvert.SerializeObject(unknownObj, new[] { new Newtonsoft.Json.Converters.StringEnumConverter() }); swaggerDataType = "string"; // object can not attach formData. } @@ -488,4 +490,4 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ return property; } -} \ No newline at end of file +} diff --git a/tests/MagicOnion.Integration.Tests/StreamingHubClientResultTest.cs b/tests/MagicOnion.Integration.Tests/StreamingHubClientResultTest.cs index 511f0deb1..c715a588d 100644 --- a/tests/MagicOnion.Integration.Tests/StreamingHubClientResultTest.cs +++ b/tests/MagicOnion.Integration.Tests/StreamingHubClientResultTest.cs @@ -8,7 +8,7 @@ namespace MagicOnion.Integration.Tests; -public class StreamingHubClientResultTest(MagicOnionApplicationFactory factory, ITestOutputHelper testOutputHelper) : IClassFixture> +public class StreamingHubClientResultTest(MagicOnionApplicationFactory factory) : IClassFixture> { readonly MagicOnionApplicationFactory factory = factory;