diff --git a/MagicOnion.Packaging.slnf b/MagicOnion.Packaging.slnf index e26d6a6c3..0b26fffba 100644 --- a/MagicOnion.Packaging.slnf +++ b/MagicOnion.Packaging.slnf @@ -4,6 +4,7 @@ "projects": [ "src\\MagicOnion.Abstractions\\MagicOnion.Abstractions.csproj", "src\\MagicOnion.Client\\MagicOnion.Client.csproj", + "src\\MagicOnion.Serialization.MessagePack\\MagicOnion.Serialization.MessagePack.csproj", "src\\MagicOnion.Serialization.MemoryPack\\MagicOnion.Serialization.MemoryPack.csproj", "src\\MagicOnion.Server.HttpGateway\\MagicOnion.Server.HttpGateway.csproj", "src\\MagicOnion.Server.Redis\\MagicOnion.Server.Redis.csproj", diff --git a/MagicOnion.sln b/MagicOnion.sln index 39eee5544..9eb9b7bbf 100644 --- a/MagicOnion.sln +++ b/MagicOnion.sln @@ -73,8 +73,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicServerSample", "tests\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Client.Tests", "tests\MagicOnion.Client.Tests\MagicOnion.Client.Tests.csproj", "{6DF31417-D091-4E27-963F-75E1D5AC0EA0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Shared.Tests", "tests\MagicOnion.Shared.Tests\MagicOnion.Shared.Tests.csproj", "{A6DB6E90-711E-4832-B8F0-BEB14E31B77C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Integration.Tests", "tests\MagicOnion.Integration.Tests\MagicOnion.Integration.Tests.csproj", "{EC4E0789-6A32-42FA-ABD7-7ED3A5004CFF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnionTestServer", "tests\samples\MagicOnionTestServer\MagicOnionTestServer.csproj", "{D0555A91-D817-4322-B8D0-16641069D17B}" @@ -111,6 +109,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SourceGeneratorPerf", "Sour EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorPerf", "perf\SourceGeneratorPerf\SourceGeneratorPerf\SourceGeneratorPerf.csproj", "{7F132098-0C1D-4F3A-B049-ACABF5E35973}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Serialization.MessagePack", "src\MagicOnion.Serialization.MessagePack\MagicOnion.Serialization.MessagePack.csproj", "{6C34E9BF-4E05-4A73-B439-75F3369B88A8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Internal", "src\MagicOnion.Internal\MagicOnion.Internal.csproj", "{2996029B-D329-499F-8525-69614A820135}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion.Serialization.MessagePack.Tests", "tests\MagicOnion.Serialization.MessagePack.Tests\MagicOnion.Serialization.MessagePack.Tests.csproj", "{701E193F-587D-4C20-8970-6E215B0634F8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Abstractions.Tests", "tests\MagicOnion.Abstractions.Tests\MagicOnion.Abstractions.Tests.csproj", "{D340EFB8-128A-4B49-A47A-F00A905D10AC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -181,10 +187,6 @@ Global {6DF31417-D091-4E27-963F-75E1D5AC0EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU {6DF31417-D091-4E27-963F-75E1D5AC0EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU {6DF31417-D091-4E27-963F-75E1D5AC0EA0}.Release|Any CPU.Build.0 = Release|Any CPU - {A6DB6E90-711E-4832-B8F0-BEB14E31B77C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6DB6E90-711E-4832-B8F0-BEB14E31B77C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6DB6E90-711E-4832-B8F0-BEB14E31B77C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6DB6E90-711E-4832-B8F0-BEB14E31B77C}.Release|Any CPU.Build.0 = Release|Any CPU {EC4E0789-6A32-42FA-ABD7-7ED3A5004CFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EC4E0789-6A32-42FA-ABD7-7ED3A5004CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU {EC4E0789-6A32-42FA-ABD7-7ED3A5004CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -245,6 +247,22 @@ Global {7F132098-0C1D-4F3A-B049-ACABF5E35973}.Debug|Any CPU.Build.0 = Debug|Any CPU {7F132098-0C1D-4F3A-B049-ACABF5E35973}.Release|Any CPU.ActiveCfg = Release|Any CPU {7F132098-0C1D-4F3A-B049-ACABF5E35973}.Release|Any CPU.Build.0 = Release|Any CPU + {6C34E9BF-4E05-4A73-B439-75F3369B88A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C34E9BF-4E05-4A73-B439-75F3369B88A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C34E9BF-4E05-4A73-B439-75F3369B88A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C34E9BF-4E05-4A73-B439-75F3369B88A8}.Release|Any CPU.Build.0 = Release|Any CPU + {2996029B-D329-499F-8525-69614A820135}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2996029B-D329-499F-8525-69614A820135}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2996029B-D329-499F-8525-69614A820135}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2996029B-D329-499F-8525-69614A820135}.Release|Any CPU.Build.0 = Release|Any CPU + {701E193F-587D-4C20-8970-6E215B0634F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {701E193F-587D-4C20-8970-6E215B0634F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {701E193F-587D-4C20-8970-6E215B0634F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {701E193F-587D-4C20-8970-6E215B0634F8}.Release|Any CPU.Build.0 = Release|Any CPU + {D340EFB8-128A-4B49-A47A-F00A905D10AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D340EFB8-128A-4B49-A47A-F00A905D10AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D340EFB8-128A-4B49-A47A-F00A905D10AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D340EFB8-128A-4B49-A47A-F00A905D10AC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -270,7 +288,6 @@ Global {4D5E8486-9A0D-444A-922B-1D94FD8A820A} = {B5617CC1-55FD-4F77-BA75-9450474C6527} {BC29EA94-6C52-4FAA-8F26-9346DB85C58F} = {B5617CC1-55FD-4F77-BA75-9450474C6527} {6DF31417-D091-4E27-963F-75E1D5AC0EA0} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0} - {A6DB6E90-711E-4832-B8F0-BEB14E31B77C} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0} {EC4E0789-6A32-42FA-ABD7-7ED3A5004CFF} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0} {D0555A91-D817-4322-B8D0-16641069D17B} = {B5617CC1-55FD-4F77-BA75-9450474C6527} {2FF12B46-BA5C-4B6C-BD94-3556C3F25722} = {A0CED9FB-5B18-4EE3-859F-CE3A6F90A82A} @@ -288,6 +305,10 @@ Global {AFB26C11-0833-459D-B071-7CA001BD7F01} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0} {E9E11DFE-29C4-4933-A21B-2222646D946E} = {A0CED9FB-5B18-4EE3-859F-CE3A6F90A82A} {7F132098-0C1D-4F3A-B049-ACABF5E35973} = {E9E11DFE-29C4-4933-A21B-2222646D946E} + {6C34E9BF-4E05-4A73-B439-75F3369B88A8} = {1987061F-8970-4018-8D58-6932961C9EB4} + {2996029B-D329-499F-8525-69614A820135} = {1987061F-8970-4018-8D58-6932961C9EB4} + {701E193F-587D-4C20-8970-6E215B0634F8} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0} + {D340EFB8-128A-4B49-A47A-F00A905D10AC} = {7ACC27E8-8FBE-4807-B91F-B89AF3CFF7E0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D5B2E7E3-B727-40A1-BE68-7BAC9B9DE2FE} diff --git a/perf/BenchmarkApp/PerformanceTest.Client/Program.cs b/perf/BenchmarkApp/PerformanceTest.Client/Program.cs index 4c85ad21d..111c5e67d 100644 --- a/perf/BenchmarkApp/PerformanceTest.Client/Program.cs +++ b/perf/BenchmarkApp/PerformanceTest.Client/Program.cs @@ -5,6 +5,7 @@ using MagicOnion.Client; using MagicOnion.Serialization; using MagicOnion.Serialization.MemoryPack; +using MagicOnion.Serialization.MessagePack; using PerformanceTest.Shared; var app = ConsoleApp.Create(args); diff --git a/perf/SourceGeneratorPerf/SourceGeneratorPerf/CompilationHelper.cs b/perf/SourceGeneratorPerf/SourceGeneratorPerf/CompilationHelper.cs index 46e9c81b6..0f77c0d78 100644 --- a/perf/SourceGeneratorPerf/SourceGeneratorPerf/CompilationHelper.cs +++ b/perf/SourceGeneratorPerf/SourceGeneratorPerf/CompilationHelper.cs @@ -27,7 +27,7 @@ public static (Compilation Compilation, SemanticModel SemanticModel) Create(stri MetadataReference.CreateFromFile(typeof(MessagePack.MessagePackObjectAttribute).Assembly.Location), // MessagePack.Annotations MetadataReference.CreateFromFile(typeof(MagicOnion.IService<>).Assembly.Location), // MagicOnion.Abstractions MetadataReference.CreateFromFile(typeof(MagicOnion.Client.MagicOnionClient).Assembly.Location), // MagicOnion.Client - MetadataReference.CreateFromFile(typeof(MagicOnion.Internal.GrpcMethodHelper).Assembly.Location), // MagicOnion.Shared + MetadataReference.CreateFromFile(typeof(MagicOnion.Serialization.MagicOnionSerializerProvider).Assembly.Location), // MagicOnion.Shared }; var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary); diff --git a/src/MagicOnion.Abstractions/DynamicArgumentTuple.cs b/src/MagicOnion.Abstractions/DynamicArgumentTuple.cs new file mode 100644 index 000000000..ab4da604c --- /dev/null +++ b/src/MagicOnion.Abstractions/DynamicArgumentTuple.cs @@ -0,0 +1,523 @@ + +using System; +using System.Runtime.InteropServices; +using MessagePack; +using MessagePack.Formatters; + +namespace MagicOnion +{ + // T2 ~ T15 + // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. + + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2) + { + Item1 = item1; + Item2 = item2; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + [Key(12)] + public readonly T13 Item13; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + Item13 = item13; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + [Key(12)] + public readonly T13 Item13; + [Key(13)] + public readonly T14 Item14; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + Item13 = item13; + Item14 = item14; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + [Key(12)] + public readonly T13 Item13; + [Key(13)] + public readonly T14 Item14; + [Key(14)] + public readonly T15 Item15; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + Item13 = item13; + Item14 = item14; + Item15 = item15; + } + } +} diff --git a/src/MagicOnion.Abstractions/DynamicArgumentTuple.tt b/src/MagicOnion.Abstractions/DynamicArgumentTuple.tt new file mode 100644 index 000000000..f634df19c --- /dev/null +++ b/src/MagicOnion.Abstractions/DynamicArgumentTuple.tt @@ -0,0 +1,44 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> + +using System; +using System.Runtime.InteropServices; +using MessagePack; +using MessagePack.Formatters; + +namespace MagicOnion +{ + // T2 ~ T15 + // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. + +<# for(var i = 2; i <= 15; i++) { + var typeArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0}", x))); + var methodArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0} item{0}", x))); + var defaultArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0} default{0}", x))); + var itemArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("item{0}", x))); + #> + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple<<#= typeArgs #>> + { +<# for(var j = 1; j <= i; j++) { #> + [Key(<#= j - 1 #>)] + public readonly T<#= j#> Item<#= j #>; +<# } #> + + [SerializationConstructor] + public DynamicArgumentTuple(<#= methodArgs #>) + { +<# for(var j = 1; j <= i; j++) { #> + Item<#= j#> = item<#= j #>; +<# } #> + } + } +<# } #> +} diff --git a/src/MagicOnion.Abstractions/MagicOnion.Abstractions.csproj b/src/MagicOnion.Abstractions/MagicOnion.Abstractions.csproj index b6c78be70..dc3a0d4a6 100644 --- a/src/MagicOnion.Abstractions/MagicOnion.Abstractions.csproj +++ b/src/MagicOnion.Abstractions/MagicOnion.Abstractions.csproj @@ -32,6 +32,22 @@ MagicOnion.IgnoreAttribute + + + DynamicArgumentTuple.cs + TextTemplatingFileGenerator + + + + + + + + True + True + DynamicArgumentTuple.tt + + diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs b/src/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs similarity index 69% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs rename to src/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs index 50f992aa5..900972837 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs +++ b/src/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs @@ -26,15 +26,4 @@ public interface IMagicOnionSerializer void Serialize(IBufferWriter writer, in T value); T Deserialize(in ReadOnlySequence bytes); } - - /// - /// Provides a serializer for request/response of MagicOnion services and hub methods. - /// - public static class MagicOnionSerializerProvider - { - /// - /// Gets or sets the to be used by default. - /// - public static IMagicOnionSerializerProvider Default { get; set; } = MessagePackMagicOnionSerializerProvider.Default; - } } diff --git a/src/MagicOnion.Client.SourceGenerator/CodeAnalysis/SerializationFormatterNameMapper.cs b/src/MagicOnion.Client.SourceGenerator/CodeAnalysis/SerializationFormatterNameMapper.cs index 0fe9917bf..7e618446b 100644 --- a/src/MagicOnion.Client.SourceGenerator/CodeAnalysis/SerializationFormatterNameMapper.cs +++ b/src/MagicOnion.Client.SourceGenerator/CodeAnalysis/SerializationFormatterNameMapper.cs @@ -43,7 +43,7 @@ public bool TryMapGeneric(MagicOnionTypeInfo type, [NotNullWhen(true)] out strin { // MagicOnion.DynamicArgumentTuple var ctorArguments = string.Join(", ", type.GenericArguments.Select(x => $"default({x.FullName})")); - formatterName = $"global::MagicOnion.DynamicArgumentTupleFormatter<{genericTypeArgs}>"; + formatterName = $"global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter<{genericTypeArgs}>"; formatterConstructorArgs = $"({ctorArguments})"; } else if (MessagePackWellKnownSerializationTypes.Instance.GenericFormattersMap.TryGetValue(type.FullNameOpenType, out var mappedFormatterName)) diff --git a/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticMagicOnionClientGenerator.cs b/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticMagicOnionClientGenerator.cs index 61eb37ded..4894e6fd3 100644 --- a/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticMagicOnionClientGenerator.cs +++ b/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticMagicOnionClientGenerator.cs @@ -55,12 +55,6 @@ namespace {{generationContext.Namespace}} """); } ctx.Writer.AppendLineWithFormat($$""" - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class {{generationContext.InitializerPartialTypeName}} { static partial class MagicOnionGeneratedClient @@ -129,7 +123,7 @@ static void EmitConstructor(ServiceClientBuildContext ctx) this.core = new ClientCore(serializerProvider); } - private {{ctx.Service.GetClientFullName()}}(MagicOnionClientOptions options, ClientCore core) : base(options) + private {{ctx.Service.GetClientFullName()}}(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs b/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs index c88b89ab0..bc1c8269a 100644 --- a/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs +++ b/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs @@ -57,12 +57,6 @@ namespace {{generationContext.Namespace}} """); } ctx.Writer.AppendLineWithFormat($$""" - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class {{generationContext.InitializerPartialTypeName}} { static partial class MagicOnionGeneratedClient @@ -106,20 +100,14 @@ public class {{ctx.Hub.GetClientFullName()}} : global::MagicOnion.Client.Streami static void EmitProperties(StreamingHubClientBuildContext ctx) { - ctx.Writer.AppendLine(""" - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - - """); } static void EmitConstructor(StreamingHubClientBuildContext ctx) { ctx.Writer.AppendLineWithFormat($$""" public {{ctx.Hub.GetClientFullName()}}(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("{{ctx.Hub.ServiceType.Name}}", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "{{ctx.Hub.ServiceType.Name}}", "Connect", marshaller, marshaller); } """); ctx.Writer.AppendLine(); diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/DynamicArgumentTuple.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/DynamicArgumentTuple.cs new file mode 100644 index 000000000..ab4da604c --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/DynamicArgumentTuple.cs @@ -0,0 +1,523 @@ + +using System; +using System.Runtime.InteropServices; +using MessagePack; +using MessagePack.Formatters; + +namespace MagicOnion +{ + // T2 ~ T15 + // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. + + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2) + { + Item1 = item1; + Item2 = item2; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + [Key(12)] + public readonly T13 Item13; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + Item13 = item13; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + [Key(12)] + public readonly T13 Item13; + [Key(13)] + public readonly T14 Item14; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + Item13 = item13; + Item14 = item14; + } + } + + [MessagePackObject] + [StructLayout(LayoutKind.Auto)] + public struct DynamicArgumentTuple + { + [Key(0)] + public readonly T1 Item1; + [Key(1)] + public readonly T2 Item2; + [Key(2)] + public readonly T3 Item3; + [Key(3)] + public readonly T4 Item4; + [Key(4)] + public readonly T5 Item5; + [Key(5)] + public readonly T6 Item6; + [Key(6)] + public readonly T7 Item7; + [Key(7)] + public readonly T8 Item8; + [Key(8)] + public readonly T9 Item9; + [Key(9)] + public readonly T10 Item10; + [Key(10)] + public readonly T11 Item11; + [Key(11)] + public readonly T12 Item12; + [Key(12)] + public readonly T13 Item13; + [Key(13)] + public readonly T14 Item14; + [Key(14)] + public readonly T15 Item15; + + [SerializationConstructor] + public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15) + { + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + Item6 = item6; + Item7 = item7; + Item8 = item8; + Item9 = item9; + Item10 = item10; + Item11 = item11; + Item12 = item12; + Item13 = item13; + Item14 = item14; + Item15 = item15; + } + } +} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/DynamicArgumentTuple.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/DynamicArgumentTuple.cs.meta index 4579a5d5c..7a58b4981 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/DynamicArgumentTuple.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 33a59c39b7cd18641a98073a63aedc21 +guid: 8dd5b351ac83e954aaf6fc3552c2d059 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Shared/InternalsVisibleTo.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/InternalsVisibleTo.cs similarity index 64% rename from src/MagicOnion.Shared/InternalsVisibleTo.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/InternalsVisibleTo.cs index 0b7005810..fcac9d922 100644 --- a/src/MagicOnion.Shared/InternalsVisibleTo.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/InternalsVisibleTo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: InternalsVisibleTo("MagicOnion.Client, PublicKey=" + +[assembly: InternalsVisibleTo("MagicOnion, PublicKey=" + "0024000004800000940000000602000000240000525341310004000001000100f1ee449290a813" + "77cf1a6d598f10a3e2de6c45ee5377140b179b7a2260007c4ba633a6f766a0b3392ae2160819d6" + "25d9d9d65a134b722fd4e637793479d6c8d72490f9992293ee53933205620245e55fcddb7ce639" + @@ -15,10 +15,3 @@ "25d9d9d65a134b722fd4e637793479d6c8d72490f9992293ee53933205620245e55fcddb7ce639" + "5d72c94365a432808fbcf1bf8ff2932a1263715f8bc73bb25b96366f118c58e24da5f2bee32223" + "948d7bc5")] - -[assembly: InternalsVisibleTo("MagicOnion.Server.Redis, PublicKey=" + - "0024000004800000940000000602000000240000525341310004000001000100f1ee449290a813" + - "77cf1a6d598f10a3e2de6c45ee5377140b179b7a2260007c4ba633a6f766a0b3392ae2160819d6" + - "25d9d9d65a134b722fd4e637793479d6c8d72490f9992293ee53933205620245e55fcddb7ce639" + - "5d72c94365a432808fbcf1bf8ff2932a1263715f8bc73bb25b96366f118c58e24da5f2bee32223" + - "948d7bc5")] diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/InternalsVisibleTo.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/InternalsVisibleTo.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/InternalsVisibleTo.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/InternalsVisibleTo.cs.meta index cfc4093c7..eb2409aad 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/InternalsVisibleTo.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/InternalsVisibleTo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3b707ec98a56f7342944cc7815adf94b +guid: 40714699e8805dd48aade7a1d5afa9b7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization.meta similarity index 77% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization.meta index 1f87b174c..100e6f36a 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c78772ea6066000439c992ff5e8fc6ae +guid: c835f02184d5fda46a615900d3ed5564 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs new file mode 100644 index 000000000..900972837 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs @@ -0,0 +1,29 @@ +using System.Buffers; +using System.Reflection; +using Grpc.Core; + +namespace MagicOnion.Serialization +{ + /// + /// Provides a serializer for request/response of MagicOnion services and hub methods. + /// + public interface IMagicOnionSerializerProvider + { + /// + /// Create a serializer for the service method. + /// + /// gRPC method type of the method. + /// A method info for an implementation of the service method. It is a hint that handling request parameters on the server, which may be passed null on the client. + /// + IMagicOnionSerializer Create(MethodType methodType, MethodInfo? methodInfo); + } + + /// + /// Provides a processing for message serialization. + /// + public interface IMagicOnionSerializer + { + void Serialize(IBufferWriter writer, in T value); + T Deserialize(in ReadOnlySequence bytes); + } +} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs.meta new file mode 100644 index 000000000..427272652 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Abstractions/Serialization/MagicOnionSerializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4cd7f171c2f5cbe49845244b4605239f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs index 5e1423a01..36e494043 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs @@ -53,9 +53,6 @@ static class DynamicStreamingHubClientBuilder public static readonly Type ClientType; // static readonly Type ClientFireAndForgetType; - static readonly Type bytesMethod = typeof(Method<,>).MakeGenericType(new[] { typeof(byte[]), typeof(byte[]) }); - static readonly FieldInfo throughMarshaller = typeof(MagicOnionMarshallers).GetField("ThroughMarshaller", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)!; - static readonly ConstructorInfo notSupportedException = typeof(NotSupportedException).GetConstructor(Type.EmptyTypes)!; static DynamicStreamingHubClientBuilder() @@ -81,9 +78,8 @@ static DynamicStreamingHubClientBuilder() DefineMethodsFireAndForget(typeBuilderEx, t, fireAndForgetField, typeBuilder, methodDefinitions); typeBuilderEx.CreateTypeInfo(); // ok to create nested type. - var methodField = DefineStaticConstructor(typeBuilder, t); var clientField = DefineConstructor(typeBuilder, t, typeof(TReceiver), fireAndForgetClientCtor); - DefineMethods(typeBuilder, t, typeof(TReceiver), methodField, clientField, methodDefinitions); + DefineMethods(typeBuilder, t, typeof(TReceiver), clientField, methodDefinitions); } ClientType = typeBuilder.CreateTypeInfo()!.AsType(); @@ -150,27 +146,6 @@ static void VerifyMethodDefinitions(MethodDefinition[] definitions) } } - static FieldInfo DefineStaticConstructor(TypeBuilder typeBuilder, Type interfaceType) - { - // static readonly Method method = new Method(MethodType.DuplexStreaming, "IFoo", "Connect", MagicOnionMarshallers.ThroughMarshaller, MagicOnionMarshallers.ThroughMarshaller); - var field = typeBuilder.DefineField("method", bytesMethod, FieldAttributes.Private | FieldAttributes.Static); - - var cctor = typeBuilder.DefineConstructor(MethodAttributes.Static, CallingConventions.Standard, Type.EmptyTypes); - var il = cctor.GetILGenerator(); - - il.EmitLdc_I4((int)MethodType.DuplexStreaming); - il.Emit(OpCodes.Ldstr, interfaceType.Name); - il.Emit(OpCodes.Ldstr, "Connect"); - il.Emit(OpCodes.Ldsfld, throughMarshaller); - il.Emit(OpCodes.Ldsfld, throughMarshaller); - il.Emit(OpCodes.Newobj, bytesMethod.GetConstructors()[0]); - il.Emit(OpCodes.Stsfld, field); - - il.Emit(OpCodes.Ret); - - return field; - } - static FieldInfo DefineConstructor(TypeBuilder typeBuilder, Type interfaceType, Type receiverType, ConstructorInfo fireAndForgetClientCtor) { // .ctor(CallInvoker callInvoker, string host, CallOptions option, IMagicOnionSerializerProvider serializerProvider, IMagicOnionClientLogger logger) :base(...) @@ -179,7 +154,9 @@ static FieldInfo DefineConstructor(TypeBuilder typeBuilder, Type interfaceType, var ctor = typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, argTypes); var il = ctor.GetILGenerator(); + // base(serviceName, callInvoker, host, option, serializerProvider, logger); il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Ldstr, interfaceType.Name); il.Emit(OpCodes.Ldarg_1); il.Emit(OpCodes.Ldarg_2); il.Emit(OpCodes.Ldarg_3); @@ -223,23 +200,11 @@ static Tuple DefineFireAndForgetConstructor(Ty } } - static void DefineMethods(TypeBuilder typeBuilder, Type interfaceType, Type receiverType, FieldInfo methodField, FieldInfo clientField, MethodDefinition[] definitions) + static void DefineMethods(TypeBuilder typeBuilder, Type interfaceType, Type receiverType, FieldInfo clientField, MethodDefinition[] definitions) { var baseType = typeof(StreamingHubClientBase<,>).MakeGenericType(interfaceType, receiverType); - var serializerOptionsField = baseType.GetField("serializerOptions", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)!; var receiverField = baseType.GetField("receiver", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)!; - // protected abstract Method DuplexStreamingAsyncMethod { get; } - { - var method = typeBuilder.DefineMethod("get_DuplexStreamingAsyncMethod", MethodAttributes.Public | MethodAttributes.Final | MethodAttributes.Virtual, - bytesMethod, - Type.EmptyTypes); - var il = method.GetILGenerator(); - - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Ldfld, methodField); - il.Emit(OpCodes.Ret); - } { // Task DisposeAsync(); { diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared.meta new file mode 100644 index 000000000..298a8d169 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 119f63cf6f3ff8f419315117ce47b136 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/BroadcasterHelper.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/BroadcasterHelper.cs similarity index 98% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/BroadcasterHelper.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/BroadcasterHelper.cs index a7bbb5f0d..ceaa5b6f8 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/BroadcasterHelper.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/BroadcasterHelper.cs @@ -6,7 +6,7 @@ namespace MagicOnion.Internal { - public static class BroadcasterHelper + internal static class BroadcasterHelper { internal static Type[] DynamicArgumentTupleTypes { get; } = typeof(DynamicArgumentTuple<,>) .GetTypeInfo() diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/BroadcasterHelper.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/BroadcasterHelper.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/BroadcasterHelper.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/BroadcasterHelper.cs.meta index 3b5723cf9..3da5b26bb 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/BroadcasterHelper.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/BroadcasterHelper.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 83b6383bc81f45443b8f361544423c38 +guid: c946b2c19d344c64b9717edaa3133ce9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers.meta similarity index 77% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers.meta index 52c7f1d2c..c409594bf 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d3d69d225c61e4c4a9c8d5c924ea6341 +guid: 4cdaf079c947f434cbc0bd3caca450df folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers/ArrayPoolBufferWriter.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers/ArrayPoolBufferWriter.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers/ArrayPoolBufferWriter.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers/ArrayPoolBufferWriter.cs.meta index 642b21e4e..d53be68bf 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Buffers/ArrayPoolBufferWriter.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0fcb6f2ded3242a41bcc07154dea3463 +guid: b9fc27169a51c744186a4e0802ac9c75 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/DangerousDummyNull.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/DangerousDummyNull.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/DangerousDummyNull.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/DangerousDummyNull.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/DangerousDummyNull.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/DangerousDummyNull.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/DangerousDummyNull.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/DangerousDummyNull.cs.meta index b0796c1f7..09644b6d9 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/DangerousDummyNull.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/DangerousDummyNull.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 52bb172221d7052429406646b7d441ca +guid: bc2d28a792f15264d8c3e9d108a2af7e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/FNV1A32.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/FNV1A32.cs similarity index 94% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/FNV1A32.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/FNV1A32.cs index 448cbbb89..d9209ea8a 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/FNV1A32.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/FNV1A32.cs @@ -2,7 +2,7 @@ namespace MagicOnion.Internal { - public static class FNV1A32 + internal static class FNV1A32 { public static int GetHashCode(string str) { diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/FNV1A32.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/FNV1A32.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/FNV1A32.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/FNV1A32.cs.meta index 42a7f3db0..c472c6251 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/FNV1A32.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/FNV1A32.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bf9d0f9f359604b42abbec84f872e991 +guid: 22c7c5f79241e3646b8c4f4ddd5bd707 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/GrpcMethodHelper.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/GrpcMethodHelper.cs similarity index 99% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/GrpcMethodHelper.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/GrpcMethodHelper.cs index feb3f934d..1d134de7a 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/GrpcMethodHelper.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/GrpcMethodHelper.cs @@ -7,7 +7,7 @@ namespace MagicOnion.Internal { - public static class GrpcMethodHelper + internal static class GrpcMethodHelper { public sealed class MagicOnionMethod { diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/GrpcMethodHelper.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/GrpcMethodHelper.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/GrpcMethodHelper.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/GrpcMethodHelper.cs.meta index e4c7bfd14..e467a481a 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/GrpcMethodHelper.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/GrpcMethodHelper.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 73c8baff13917a54f87d80763b87c969 +guid: 9a0f20ba9be861644acdb995029bec23 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionAsyncStreamReader.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionAsyncStreamReader.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionAsyncStreamReader.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionAsyncStreamReader.cs.meta index d920fc44f..b0d54a969 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionAsyncStreamReader.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bf780cc5de1bf8e488f8e2763314ba72 +guid: f76cf1c1663cf4b428142bda3bfc09c6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionClientStreamWriter.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionClientStreamWriter.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionClientStreamWriter.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionClientStreamWriter.cs.meta index 9ff636218..8d88f0925 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionClientStreamWriter.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e17e5da1600a0ed40ac8440b6875f664 +guid: 51b64ceeab47061449ef441a022b3414 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionMarshallers.cs similarity index 83% rename from src/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionMarshallers.cs index dda8b02da..6e93ee430 100644 --- a/src/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionMarshallers.cs @@ -7,7 +7,7 @@ namespace MagicOnion.Internal { // invoke from dynamic methods so must be public - public static class MagicOnionMarshallers + internal static class MagicOnionMarshallers { static readonly Type[] dynamicArgumentTupleTypes = typeof(DynamicArgumentTuple<,>).GetTypeInfo().Assembly .GetTypes() @@ -15,12 +15,6 @@ public static class MagicOnionMarshallers .OrderBy(x => x.GetGenericArguments().Length) .ToArray(); - static readonly Type[] dynamicArgumentTupleFormatterTypes = typeof(DynamicArgumentTupleFormatter<,,>).GetTypeInfo().Assembly - .GetTypes() - .Where(x => x.Name.StartsWith("DynamicArgumentTupleFormatter")) - .OrderBy(x => x.GetGenericArguments().Length) - .ToArray(); - public static readonly Marshaller ThroughMarshaller = new Marshaller(x => x, x => x); internal static Type CreateRequestType(ParameterInfo[] parameters) diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionMarshallers.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionMarshallers.cs.meta index 03df75a4c..22b87b847 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionMarshallers.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3af0af107fe51d942ad8638c5c9f0a30 +guid: 23389d05750846a4fadb9ac3b2dbb674 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionServerStreamWriter.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionServerStreamWriter.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionServerStreamWriter.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionServerStreamWriter.cs.meta index 1e633d5b1..fea6be837 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/MagicOnionServerStreamWriter.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3ed64ea533b82ad4dbe09c80c3c5b6fe +guid: c1833985c3acd004aacaa46e90aa480e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection.meta similarity index 77% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection.meta index 2fc53b31a..1c9bcf3d5 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6dc40ea58fc3d634da4c4f98218069d0 +guid: a14c062eb0d92444eb4e8ba9602e6856 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/DynamicAssembly.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/DynamicAssembly.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/DynamicAssembly.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/DynamicAssembly.cs.meta index 926a2ffed..9df01c708 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/DynamicAssembly.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a8308079258dbb24db9f0c0c08bf4d94 +guid: 40ee9f0614e9da643937d825b69ef7aa MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/ILGeneratorExtensions.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/ILGeneratorExtensions.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/ILGeneratorExtensions.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/ILGeneratorExtensions.cs.meta index ca355162e..cbec4c40e 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/Internal.Shared/Reflection/ILGeneratorExtensions.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c386e9ab0ad3b5042a882136f7693bdd +guid: f881f78c2b7a8a7499c2f44a448c2c72 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity/MagicOnion.Client.SourceGenerator.Unity.dll b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity/MagicOnion.Client.SourceGenerator.Unity.dll index cca91f78c..12a3cb7e1 100644 Binary files a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity/MagicOnion.Client.SourceGenerator.Unity.dll and b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity/MagicOnion.Client.SourceGenerator.Unity.dll differ diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.asmdef b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.asmdef index 3b3c16c07..13e33f51c 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.asmdef +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.asmdef @@ -1,11 +1,12 @@ { "name": "MagicOnion.Client", + "rootNamespace": "", "references": [ "MagicOnion.Abstractions", + "MagicOnion.Shared", "MessagePack", "MessagePack.Annotations" ], - "optionalUnityReferences": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, @@ -15,5 +16,7 @@ "Grpc.Core.Api.dll" ], "autoReferenced": true, - "defineConstraints": [] + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.tt b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.tt deleted file mode 100644 index 83cc6092d..000000000 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.tt +++ /dev/null @@ -1,91 +0,0 @@ -<#@ template debug="false" hostspecific="false" language="C#" #> -<#@ assembly name="System.Core" #> -<#@ import namespace="System" #> -<#@ import namespace="System.Linq" #> -<#@ import namespace="System.Text" #> -<#@ import namespace="System.Collections.Generic" #> -<#@ output extension=".cs" #> - -using System; -using MessagePack; -using MessagePack.Formatters; - -namespace MagicOnion -{ - // T2 ~ T20 - -<# for(var i = 2; i <= 20; i++) { - var typeArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0}", x))); - var methodArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0} item{0}", x))); - var defaultArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0} default{0}", x))); - var itemArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("item{0}", x))); - #> - - [MessagePackObject] - public struct DynamicArgumentTuple<<#= typeArgs #>> - { -<# for(var j = 1; j <= i; j++) { #> - [Key(<#= j - 1 #>)] - public readonly T<#= j#> Item<#= j #>; -<# } #> - - [SerializationConstructor] - public DynamicArgumentTuple(<#= methodArgs #>) - { -<# for(var j = 1; j <= i; j++) { #> - Item<#= j#> = item<#= j #>; -<# } #> - } - } - - public class DynamicArgumentTupleFormatter<<#= typeArgs #>> : IMessagePackFormatter>> - { -<# for(var j = 1; j <= i; j++) { #> - readonly T<#= j #> default<#= j #>; -<# } #> - - public DynamicArgumentTupleFormatter(<#= defaultArgs #>) - { -<# for(var j = 1; j <= i; j++) { #> - this.default<#= j #> = default<#= j #>; -<# } #> - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple<<#= typeArgs #>> value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(<#= i #>); - var resolver = options.Resolver; -<# for(var j = 1; j <= i; j++) { #> - resolver.GetFormatterWithVerify>().Serialize(ref writer, value.Item<#= j #>, options); -<# } #> - } - - public DynamicArgumentTuple<<#= typeArgs #>> Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - -<# for(var j = 1; j <= i; j++) { #> - var item<#= j #> = default<#= j #>; -<# } #> - - for (var i = 0; i < length; i++) - { - switch (i) - { -<# for(var j = 1; j <= i; j++) { #> - case <#= j - 1 #>: - item<#= j #> = resolver.GetFormatterWithVerify>().Deserialize(ref reader, options); - break; -<# } #> - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple<<#= typeArgs #>>(<#= itemArgs #>); - } - } -<# } #> -} \ No newline at end of file diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/InternalsVisibleTo.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/InternalsVisibleTo.cs deleted file mode 100644 index 0b7005810..000000000 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/InternalsVisibleTo.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: InternalsVisibleTo("MagicOnion.Client, PublicKey=" + - "0024000004800000940000000602000000240000525341310004000001000100f1ee449290a813" + - "77cf1a6d598f10a3e2de6c45ee5377140b179b7a2260007c4ba633a6f766a0b3392ae2160819d6" + - "25d9d9d65a134b722fd4e637793479d6c8d72490f9992293ee53933205620245e55fcddb7ce639" + - "5d72c94365a432808fbcf1bf8ff2932a1263715f8bc73bb25b96366f118c58e24da5f2bee32223" + - "948d7bc5")] - -[assembly: InternalsVisibleTo("MagicOnion.Server, PublicKey=" + - "0024000004800000940000000602000000240000525341310004000001000100f1ee449290a813" + - "77cf1a6d598f10a3e2de6c45ee5377140b179b7a2260007c4ba633a6f766a0b3392ae2160819d6" + - "25d9d9d65a134b722fd4e637793479d6c8d72490f9992293ee53933205620245e55fcddb7ce639" + - "5d72c94365a432808fbcf1bf8ff2932a1263715f8bc73bb25b96366f118c58e24da5f2bee32223" + - "948d7bc5")] - -[assembly: InternalsVisibleTo("MagicOnion.Server.Redis, PublicKey=" + - "0024000004800000940000000602000000240000525341310004000001000100f1ee449290a813" + - "77cf1a6d598f10a3e2de6c45ee5377140b179b7a2260007c4ba633a6f766a0b3392ae2160819d6" + - "25d9d9d65a134b722fd4e637793479d6c8d72490f9992293ee53933205620245e55fcddb7ce639" + - "5d72c94365a432808fbcf1bf8ff2932a1263715f8bc73bb25b96366f118c58e24da5f2bee32223" + - "948d7bc5")] diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/StreamingHubClientBase.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/StreamingHubClientBase.cs index f9302ed48..a0d8da805 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/StreamingHubClientBase.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/StreamingHubClientBase.cs @@ -1,19 +1,17 @@ -using Grpc.Core; -using MessagePack; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Text; using System.Threading; using System.Threading.Tasks; -using MagicOnion.Server; using System.Buffers; using System.Linq; -using MagicOnion.Client.Internal; +using Grpc.Core; using MagicOnion.Client.Internal.Threading; using MagicOnion.Client.Internal.Threading.Tasks; +using MagicOnion.Internal; using MagicOnion.Serialization; using MagicOnion.Internal.Buffers; +using MessagePack; namespace MagicOnion.Client { @@ -31,6 +29,7 @@ public abstract class StreamingHubClientBase readonly IMagicOnionClientLogger logger; readonly IMagicOnionSerializer messageSerializer; readonly AsyncLock asyncLock = new AsyncLock(); + readonly Method duplexStreamingConnectMethod; IClientStreamWriter writer = default!; IAsyncStreamReader reader = default!; @@ -46,8 +45,9 @@ public abstract class StreamingHubClientBase int messageId = 0; bool disposed; - protected StreamingHubClientBase(CallInvoker callInvoker, string? host, CallOptions option, IMagicOnionSerializerProvider serializerProvider, IMagicOnionClientLogger logger) + protected StreamingHubClientBase(string serviceName, CallInvoker callInvoker, string? host, CallOptions option, IMagicOnionSerializerProvider serializerProvider, IMagicOnionClientLogger logger) { + this.duplexStreamingConnectMethod = CreateConnectMethod(serviceName); this.callInvoker = callInvoker ?? throw new ArgumentNullException(nameof(callInvoker)); this.host = host; this.option = option; @@ -55,13 +55,11 @@ protected StreamingHubClientBase(CallInvoker callInvoker, string? host, CallOpti this.logger = logger ?? NullMagicOnionClientLogger.Instance; } - protected abstract Method DuplexStreamingAsyncMethod { get; } - // call immediately after create. public async Task __ConnectAndSubscribeAsync(TReceiver receiver, CancellationToken cancellationToken) { var syncContext = SynchronizationContext.Current; // capture SynchronizationContext. - var callResult = callInvoker.AsyncDuplexStreamingCall(DuplexStreamingAsyncMethod, host, option); + var callResult = callInvoker.AsyncDuplexStreamingCall(duplexStreamingConnectMethod, host, option); this.writer = callResult.RequestStream; this.reader = callResult.ResponseStream; @@ -90,7 +88,7 @@ public async Task __ConnectAndSubscribeAsync(TReceiver receiver, CancellationTok } catch (RpcException e) { - throw new RpcException(e.Status, $"Failed to connect to StreamingHub '{DuplexStreamingAsyncMethod.ServiceName}'. ({e.Status})"); + throw new RpcException(e.Status, $"Failed to connect to StreamingHub '{duplexStreamingConnectMethod.ServiceName}'. ({e.Status})"); } var firstMoveNextTask = reader.MoveNext(CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, cts.Token).Token); @@ -123,6 +121,9 @@ protected T Deserialize(ArraySegment bytes) protected abstract void OnResponseEvent(int methodId, object taskCompletionSource, ArraySegment data); protected abstract void OnBroadcastEvent(int methodId, ArraySegment data); + static Method CreateConnectMethod(string serviceName) + => new Method(MethodType.DuplexStreaming, serviceName, "Connect", MagicOnionMarshallers.ThroughMarshaller, MagicOnionMarshallers.ThroughMarshaller); + async Task StartSubscribe(SynchronizationContext? syncContext, Task firstMoveNext) { var reader = this.reader; diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack.meta new file mode 100644 index 000000000..8bc6af5d1 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e0a523d0c154694cadc4c885b26abab +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/DynamicArgumentTupleMemoryPackFormatter.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/DynamicArgumentTupleMemoryPackFormatter.cs new file mode 100644 index 000000000..4ae583aee --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/DynamicArgumentTupleMemoryPackFormatter.cs @@ -0,0 +1,764 @@ +// +#pragma warning disable CS8669 +#nullable enable + +using System.Runtime.CompilerServices; +using MemoryPack; + +namespace MagicOnion.Serialization.MemoryPack +{ + public static class DynamicArgumentTupleFormatter + { + static bool isRegistered = false; + public static void Register() + { + if (isRegistered) return; + isRegistered = true; + + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,>), typeof(DynamicArgumentTupleFormatter<,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,>), typeof(DynamicArgumentTupleFormatter<,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,>), typeof(DynamicArgumentTupleFormatter<,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,,,,,,>)); + MemoryPackFormatterProvider.RegisterGenericType(typeof(DynamicArgumentTuple<,,,,,,,,,,,,,,>), typeof(DynamicArgumentTupleFormatter<,,,,,,,,,,,,,,>)); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + writer.WriteValue(value.Item10); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + writer.WriteValue(value.Item10); + writer.WriteValue(value.Item11); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + writer.WriteValue(value.Item10); + writer.WriteValue(value.Item11); + writer.WriteValue(value.Item12); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + writer.WriteValue(value.Item10); + writer.WriteValue(value.Item11); + writer.WriteValue(value.Item12); + writer.WriteValue(value.Item13); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + writer.WriteValue(value.Item10); + writer.WriteValue(value.Item11); + writer.WriteValue(value.Item12); + writer.WriteValue(value.Item13); + writer.WriteValue(value.Item14); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] + public class DynamicArgumentTupleFormatter : MemoryPackFormatter> + { + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Serialize(ref MemoryPackWriter writer, ref DynamicArgumentTuple value) +#else + public override void Serialize(ref MemoryPackWriter writer, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + writer.DangerousWriteUnmanaged(value); + return; + } + writer.WriteValue(value.Item1); + writer.WriteValue(value.Item2); + writer.WriteValue(value.Item3); + writer.WriteValue(value.Item4); + writer.WriteValue(value.Item5); + writer.WriteValue(value.Item6); + writer.WriteValue(value.Item7); + writer.WriteValue(value.Item8); + writer.WriteValue(value.Item9); + writer.WriteValue(value.Item10); + writer.WriteValue(value.Item11); + writer.WriteValue(value.Item12); + writer.WriteValue(value.Item13); + writer.WriteValue(value.Item14); + writer.WriteValue(value.Item15); + } + + [global::MagicOnion.Serialization.MemoryPack.Preserve] +#if UNITY_2021_3_OR_NEWER + public override void Deserialize(ref MemoryPackReader reader, ref DynamicArgumentTuple value) +#else + public override void Deserialize(ref MemoryPackReader reader, scoped ref DynamicArgumentTuple value) +#endif + { + if (!System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences>()) + { + reader.DangerousReadUnmanaged(out value); + return; + } + + value = new DynamicArgumentTuple( + reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + , reader.ReadValue() + ); + } + } + +} + diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/DynamicArgumentTupleMemoryPackFormatter.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/DynamicArgumentTupleMemoryPackFormatter.cs.meta new file mode 100644 index 000000000..a3cffd5ea --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/DynamicArgumentTupleMemoryPackFormatter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cb803dbae966e343a033cfdf2a34f8d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.asmdef b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.asmdef new file mode 100644 index 000000000..2ce004562 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.asmdef @@ -0,0 +1,27 @@ +{ + "name": "MagicOnion.Serialization.MemoryPack", + "rootNamespace": "", + "references": [ + "MagicOnion.Abstractions", + "MemoryPack" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [ + "Grpc.Core.Api.dll" + ], + "autoReferenced": true, + "defineConstraints": [ + "USE_MAGICONION_MEMORYPACK" + ], + "versionDefines": [ + { + "name": "com.cysharp.memorypack", + "expression": "", + "define": "USE_MAGICONION_MEMORYPACK" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.asmdef.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.asmdef.meta new file mode 100644 index 000000000..75c25a658 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 89d3f16510173f648b111d7b1fa31127 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MemoryPackMagicOnionSerializer.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MemoryPackMagicOnionSerializer.cs new file mode 100644 index 000000000..d14084703 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MemoryPackMagicOnionSerializer.cs @@ -0,0 +1,48 @@ +#nullable enable +using System.Buffers; +using System.Reflection; +using Grpc.Core; +using MemoryPack; + +namespace MagicOnion.Serialization.MemoryPack +{ + public partial class MemoryPackMagicOnionSerializerProvider : IMagicOnionSerializerProvider + { + readonly MemoryPackSerializerOptions serializerOptions; + public static MemoryPackMagicOnionSerializerProvider Instance { get; } = new MemoryPackMagicOnionSerializerProvider(MemoryPackSerializerOptions.Default); + + MemoryPackMagicOnionSerializerProvider(MemoryPackSerializerOptions serializerOptions) + { + this.serializerOptions = serializerOptions; + } + + static MemoryPackMagicOnionSerializerProvider() + { + DynamicArgumentTupleFormatter.Register(); + } + + public MemoryPackMagicOnionSerializerProvider WithOptions(MemoryPackSerializerOptions serializerOptions) + => new MemoryPackMagicOnionSerializerProvider(serializerOptions); + + public IMagicOnionSerializer Create(MethodType methodType, MethodInfo? methodInfo) + { + return new MagicOnionSerializer(serializerOptions); + } + + class MagicOnionSerializer : IMagicOnionSerializer + { + readonly MemoryPackSerializerOptions serializerOptions; + + public MagicOnionSerializer(MemoryPackSerializerOptions serializerOptions) + { + this.serializerOptions = serializerOptions; + } + + public void Serialize(IBufferWriter writer, in T value) + => MemoryPackSerializer.Serialize(writer, value, serializerOptions); + + public T Deserialize(in ReadOnlySequence bytes) + => MemoryPackSerializer.Deserialize(bytes, serializerOptions)!; + } + } +} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MemoryPackMagicOnionSerializer.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MemoryPackMagicOnionSerializer.cs.meta new file mode 100644 index 000000000..5599bf2f8 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/MemoryPackMagicOnionSerializer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07c67629afa7a1c4ca74085cb535b40e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/PreserveAttribute.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/PreserveAttribute.cs new file mode 100644 index 000000000..3b0e0887e --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/PreserveAttribute.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MagicOnion.Serialization.MemoryPack +{ + [AttributeUsage(AttributeTargets.All)] + internal class PreserveAttribute : Attribute + { + } +} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/PreserveAttribute.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/PreserveAttribute.cs.meta new file mode 100644 index 000000000..a5ac9e53b --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/PreserveAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba49f8c126397604793c48e142f9e7a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.tt.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/csc.rsp.meta similarity index 74% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.tt.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/csc.rsp.meta index 26260fcfb..32e557693 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.tt.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MemoryPack/csc.rsp.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 59615cf4be44c9742a5323cbca21b0e5 +guid: 3d76b6e531dd33c40b3516fb32b624ed DefaultImporter: externalObjects: {} userData: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack.meta new file mode 100644 index 000000000..5e18c546f --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ed197241743cdf4c90b0c5efe8ffbc8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs similarity index 81% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs index 5d5069c88..41cfbaa43 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs @@ -4,28 +4,11 @@ using MessagePack; using MessagePack.Formatters; -namespace MagicOnion +namespace MagicOnion.Serialization.MessagePack { // T2 ~ T15 // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2) - { - Item1 = item1; - Item2 = item2; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -73,26 +56,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, Me return new DynamicArgumentTuple(item1, item2); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -147,29 +110,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReader reader return new DynamicArgumentTuple(item1, item2, item3); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -231,32 +171,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReader re return new DynamicArgumentTuple(item1, item2, item3, item4); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -325,35 +239,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReade return new DynamicArgumentTuple(item1, item2, item3, item4, item5); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -429,38 +314,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackR return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -543,41 +396,6 @@ public DynamicArgumentTuple Deserialize(ref MessageP return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -667,44 +485,6 @@ public DynamicArgumentTuple Deserialize(ref Mess return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -801,47 +581,6 @@ public DynamicArgumentTuple Deserialize(ref return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -945,50 +684,6 @@ public DynamicArgumentTuple Deserialize return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1099,53 +794,6 @@ public DynamicArgumentTuple Deseri return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1263,56 +911,6 @@ public DynamicArgumentTuple D return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - [Key(12)] - public readonly T13 Item13; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - Item13 = item13; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1437,59 +1035,6 @@ public DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - [Key(12)] - public readonly T13 Item13; - [Key(13)] - public readonly T14 Item14; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - Item13 = item13; - Item14 = item14; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1621,62 +1166,6 @@ public DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - [Key(12)] - public readonly T13 Item13; - [Key(13)] - public readonly T14 Item14; - [Key(14)] - public readonly T15 Item15; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - Item13 = item13; - Item14 = item14; - Item15 = item15; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs.meta new file mode 100644 index 000000000..4686d84b7 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 902130887a111d140ac6698465c45a84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.asmdef b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.asmdef new file mode 100644 index 000000000..4f34a158e --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.asmdef @@ -0,0 +1,18 @@ +{ + "name": "MagicOnion.Serialization.MessagePack", + "references": [ + "MagicOnion.Abstractions", + "MessagePack", + "MessagePack.Annotations" + ], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [ + "Grpc.Core.Api.dll" + ], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.asmdef.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.asmdef.meta new file mode 100644 index 000000000..92e81430f --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 38c440962436584418766c09abfa6915 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs similarity index 99% rename from src/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs index 8da58b1c3..76e0e9411 100644 --- a/src/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs @@ -6,7 +6,7 @@ using MessagePack; using MessagePack.Formatters; -namespace MagicOnion.Serialization +namespace MagicOnion.Serialization.MessagePack { /// /// Provides a using MessagePack. diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs.meta index 6b987aa29..df7d8b6a8 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: adbc3adda3400c24eba9a88a476c39f1 +guid: dc10c914c4aa5884dbe901bbcfabb765 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/UnsafeDirectBlitResolver.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs similarity index 99% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/UnsafeDirectBlitResolver.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs index 868fc3d0b..4dcefb943 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/UnsafeDirectBlitResolver.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace MagicOnion +namespace MagicOnion.Serialization.MessagePack { public class UnsafeDirectBlitResolver : IFormatterResolver { diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/UnsafeDirectBlitResolver.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs.meta similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/UnsafeDirectBlitResolver.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs.meta index 9ea84bdfa..95a5fb8bf 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/UnsafeDirectBlitResolver.cs.meta +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2bcc55af226878e40ab1831c5b0d2313 +guid: 477aead1192c6fd4bb96c547195c15ae MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/csc.rsp.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/csc.rsp.meta new file mode 100644 index 000000000..4839c2709 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Serialization.MessagePack/csc.rsp.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8fef96a8c2f1a0d4dab55326121c8d1d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared.meta similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared.meta diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MagicOnion.Shared.asmdef b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MagicOnion.Shared.asmdef new file mode 100644 index 000000000..03fca45db --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MagicOnion.Shared.asmdef @@ -0,0 +1,17 @@ +{ + "name": "MagicOnion.Shared", + "references": [ + "MagicOnion.Abstractions", + "MagicOnion.Serialization.MessagePack" + ], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [ + "Grpc.Core.Api.dll" + ], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MagicOnion.Shared.asmdef.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MagicOnion.Shared.asmdef.meta new file mode 100644 index 000000000..a73902603 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MagicOnion.Shared.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 07c110baca4842940aaf36247a516241 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MetadataExtensions.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MetadataExtensions.cs similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MetadataExtensions.cs rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MetadataExtensions.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MetadataExtensions.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MetadataExtensions.cs.meta similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MetadataExtensions.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/MetadataExtensions.cs.meta diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization.meta similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization.meta diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs new file mode 100644 index 000000000..aae908325 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs @@ -0,0 +1,15 @@ +using MagicOnion.Serialization.MessagePack; + +namespace MagicOnion.Serialization +{ + /// + /// Provides a serializer for request/response of MagicOnion services and hub methods. + /// + public static class MagicOnionSerializerProvider + { + /// + /// Gets or sets the to be used by default. + /// + public static IMagicOnionSerializerProvider Default { get; set; } = MessagePackMagicOnionSerializerProvider.Default; + } +} diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs.meta similarity index 100% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs.meta rename to src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs.meta diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/csc.rsp.meta b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/csc.rsp.meta new file mode 100644 index 000000000..20cc073e8 --- /dev/null +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Shared/csc.rsp.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c620038388a828479f39f7b1d575842 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs b/src/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs index 5e1423a01..36e494043 100644 --- a/src/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs +++ b/src/MagicOnion.Client/DynamicClient/DynamicStreamingHubClientBuilder.cs @@ -53,9 +53,6 @@ static class DynamicStreamingHubClientBuilder public static readonly Type ClientType; // static readonly Type ClientFireAndForgetType; - static readonly Type bytesMethod = typeof(Method<,>).MakeGenericType(new[] { typeof(byte[]), typeof(byte[]) }); - static readonly FieldInfo throughMarshaller = typeof(MagicOnionMarshallers).GetField("ThroughMarshaller", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)!; - static readonly ConstructorInfo notSupportedException = typeof(NotSupportedException).GetConstructor(Type.EmptyTypes)!; static DynamicStreamingHubClientBuilder() @@ -81,9 +78,8 @@ static DynamicStreamingHubClientBuilder() DefineMethodsFireAndForget(typeBuilderEx, t, fireAndForgetField, typeBuilder, methodDefinitions); typeBuilderEx.CreateTypeInfo(); // ok to create nested type. - var methodField = DefineStaticConstructor(typeBuilder, t); var clientField = DefineConstructor(typeBuilder, t, typeof(TReceiver), fireAndForgetClientCtor); - DefineMethods(typeBuilder, t, typeof(TReceiver), methodField, clientField, methodDefinitions); + DefineMethods(typeBuilder, t, typeof(TReceiver), clientField, methodDefinitions); } ClientType = typeBuilder.CreateTypeInfo()!.AsType(); @@ -150,27 +146,6 @@ static void VerifyMethodDefinitions(MethodDefinition[] definitions) } } - static FieldInfo DefineStaticConstructor(TypeBuilder typeBuilder, Type interfaceType) - { - // static readonly Method method = new Method(MethodType.DuplexStreaming, "IFoo", "Connect", MagicOnionMarshallers.ThroughMarshaller, MagicOnionMarshallers.ThroughMarshaller); - var field = typeBuilder.DefineField("method", bytesMethod, FieldAttributes.Private | FieldAttributes.Static); - - var cctor = typeBuilder.DefineConstructor(MethodAttributes.Static, CallingConventions.Standard, Type.EmptyTypes); - var il = cctor.GetILGenerator(); - - il.EmitLdc_I4((int)MethodType.DuplexStreaming); - il.Emit(OpCodes.Ldstr, interfaceType.Name); - il.Emit(OpCodes.Ldstr, "Connect"); - il.Emit(OpCodes.Ldsfld, throughMarshaller); - il.Emit(OpCodes.Ldsfld, throughMarshaller); - il.Emit(OpCodes.Newobj, bytesMethod.GetConstructors()[0]); - il.Emit(OpCodes.Stsfld, field); - - il.Emit(OpCodes.Ret); - - return field; - } - static FieldInfo DefineConstructor(TypeBuilder typeBuilder, Type interfaceType, Type receiverType, ConstructorInfo fireAndForgetClientCtor) { // .ctor(CallInvoker callInvoker, string host, CallOptions option, IMagicOnionSerializerProvider serializerProvider, IMagicOnionClientLogger logger) :base(...) @@ -179,7 +154,9 @@ static FieldInfo DefineConstructor(TypeBuilder typeBuilder, Type interfaceType, var ctor = typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, argTypes); var il = ctor.GetILGenerator(); + // base(serviceName, callInvoker, host, option, serializerProvider, logger); il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Ldstr, interfaceType.Name); il.Emit(OpCodes.Ldarg_1); il.Emit(OpCodes.Ldarg_2); il.Emit(OpCodes.Ldarg_3); @@ -223,23 +200,11 @@ static Tuple DefineFireAndForgetConstructor(Ty } } - static void DefineMethods(TypeBuilder typeBuilder, Type interfaceType, Type receiverType, FieldInfo methodField, FieldInfo clientField, MethodDefinition[] definitions) + static void DefineMethods(TypeBuilder typeBuilder, Type interfaceType, Type receiverType, FieldInfo clientField, MethodDefinition[] definitions) { var baseType = typeof(StreamingHubClientBase<,>).MakeGenericType(interfaceType, receiverType); - var serializerOptionsField = baseType.GetField("serializerOptions", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)!; var receiverField = baseType.GetField("receiver", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)!; - // protected abstract Method DuplexStreamingAsyncMethod { get; } - { - var method = typeBuilder.DefineMethod("get_DuplexStreamingAsyncMethod", MethodAttributes.Public | MethodAttributes.Final | MethodAttributes.Virtual, - bytesMethod, - Type.EmptyTypes); - var il = method.GetILGenerator(); - - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Ldfld, methodField); - il.Emit(OpCodes.Ret); - } { // Task DisposeAsync(); { diff --git a/src/MagicOnion.Client/MagicOnion.Client.csproj b/src/MagicOnion.Client/MagicOnion.Client.csproj index 15c078edb..2a2060d3b 100644 --- a/src/MagicOnion.Client/MagicOnion.Client.csproj +++ b/src/MagicOnion.Client/MagicOnion.Client.csproj @@ -13,6 +13,10 @@ MagicOnion client-side runtime library. $(MagicOnionPackageDescription) + + + + @@ -29,23 +33,39 @@ - + + - + - $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Client\ + $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Client\ + $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Client\Internal.Shared\ + $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Abstractions\ + $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Shared\ + $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Serialization.MessagePack\ + $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Serialization.MemoryPack\ - + + + + + + - + + + + + + diff --git a/src/MagicOnion.Client/StreamingHubClientBase.cs b/src/MagicOnion.Client/StreamingHubClientBase.cs index f9302ed48..a0d8da805 100644 --- a/src/MagicOnion.Client/StreamingHubClientBase.cs +++ b/src/MagicOnion.Client/StreamingHubClientBase.cs @@ -1,19 +1,17 @@ -using Grpc.Core; -using MessagePack; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Text; using System.Threading; using System.Threading.Tasks; -using MagicOnion.Server; using System.Buffers; using System.Linq; -using MagicOnion.Client.Internal; +using Grpc.Core; using MagicOnion.Client.Internal.Threading; using MagicOnion.Client.Internal.Threading.Tasks; +using MagicOnion.Internal; using MagicOnion.Serialization; using MagicOnion.Internal.Buffers; +using MessagePack; namespace MagicOnion.Client { @@ -31,6 +29,7 @@ public abstract class StreamingHubClientBase readonly IMagicOnionClientLogger logger; readonly IMagicOnionSerializer messageSerializer; readonly AsyncLock asyncLock = new AsyncLock(); + readonly Method duplexStreamingConnectMethod; IClientStreamWriter writer = default!; IAsyncStreamReader reader = default!; @@ -46,8 +45,9 @@ public abstract class StreamingHubClientBase int messageId = 0; bool disposed; - protected StreamingHubClientBase(CallInvoker callInvoker, string? host, CallOptions option, IMagicOnionSerializerProvider serializerProvider, IMagicOnionClientLogger logger) + protected StreamingHubClientBase(string serviceName, CallInvoker callInvoker, string? host, CallOptions option, IMagicOnionSerializerProvider serializerProvider, IMagicOnionClientLogger logger) { + this.duplexStreamingConnectMethod = CreateConnectMethod(serviceName); this.callInvoker = callInvoker ?? throw new ArgumentNullException(nameof(callInvoker)); this.host = host; this.option = option; @@ -55,13 +55,11 @@ protected StreamingHubClientBase(CallInvoker callInvoker, string? host, CallOpti this.logger = logger ?? NullMagicOnionClientLogger.Instance; } - protected abstract Method DuplexStreamingAsyncMethod { get; } - // call immediately after create. public async Task __ConnectAndSubscribeAsync(TReceiver receiver, CancellationToken cancellationToken) { var syncContext = SynchronizationContext.Current; // capture SynchronizationContext. - var callResult = callInvoker.AsyncDuplexStreamingCall(DuplexStreamingAsyncMethod, host, option); + var callResult = callInvoker.AsyncDuplexStreamingCall(duplexStreamingConnectMethod, host, option); this.writer = callResult.RequestStream; this.reader = callResult.ResponseStream; @@ -90,7 +88,7 @@ public async Task __ConnectAndSubscribeAsync(TReceiver receiver, CancellationTok } catch (RpcException e) { - throw new RpcException(e.Status, $"Failed to connect to StreamingHub '{DuplexStreamingAsyncMethod.ServiceName}'. ({e.Status})"); + throw new RpcException(e.Status, $"Failed to connect to StreamingHub '{duplexStreamingConnectMethod.ServiceName}'. ({e.Status})"); } var firstMoveNextTask = reader.MoveNext(CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, cts.Token).Token); @@ -123,6 +121,9 @@ protected T Deserialize(ArraySegment bytes) protected abstract void OnResponseEvent(int methodId, object taskCompletionSource, ArraySegment data); protected abstract void OnBroadcastEvent(int methodId, ArraySegment data); + static Method CreateConnectMethod(string serviceName) + => new Method(MethodType.DuplexStreaming, serviceName, "Connect", MagicOnionMarshallers.ThroughMarshaller, MagicOnionMarshallers.ThroughMarshaller); + async Task StartSubscribe(SynchronizationContext? syncContext, Task firstMoveNext) { var reader = this.reader; diff --git a/src/MagicOnion.Internal/.DO_NOT_SHIP_OR_REFERENCE_THIS_PROJECT b/src/MagicOnion.Internal/.DO_NOT_SHIP_OR_REFERENCE_THIS_PROJECT new file mode 100644 index 000000000..31c0bcd12 --- /dev/null +++ b/src/MagicOnion.Internal/.DO_NOT_SHIP_OR_REFERENCE_THIS_PROJECT @@ -0,0 +1,2 @@ +# MagicOnion.Internal +This project only contains code for link referencing and will not be released as a standalone package. The project is primarily intended for build testing purposes. diff --git a/src/MagicOnion.Shared/Internal/BroadcasterHelper.cs b/src/MagicOnion.Internal/BroadcasterHelper.cs similarity index 98% rename from src/MagicOnion.Shared/Internal/BroadcasterHelper.cs rename to src/MagicOnion.Internal/BroadcasterHelper.cs index a7bbb5f0d..ceaa5b6f8 100644 --- a/src/MagicOnion.Shared/Internal/BroadcasterHelper.cs +++ b/src/MagicOnion.Internal/BroadcasterHelper.cs @@ -6,7 +6,7 @@ namespace MagicOnion.Internal { - public static class BroadcasterHelper + internal static class BroadcasterHelper { internal static Type[] DynamicArgumentTupleTypes { get; } = typeof(DynamicArgumentTuple<,>) .GetTypeInfo() diff --git a/src/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs b/src/MagicOnion.Internal/Buffers/ArrayPoolBufferWriter.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/Buffers/ArrayPoolBufferWriter.cs rename to src/MagicOnion.Internal/Buffers/ArrayPoolBufferWriter.cs diff --git a/src/MagicOnion.Shared/Internal/DangerousDummyNull.cs b/src/MagicOnion.Internal/DangerousDummyNull.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/DangerousDummyNull.cs rename to src/MagicOnion.Internal/DangerousDummyNull.cs diff --git a/src/MagicOnion.Shared/Internal/FNV1A32.cs b/src/MagicOnion.Internal/FNV1A32.cs similarity index 94% rename from src/MagicOnion.Shared/Internal/FNV1A32.cs rename to src/MagicOnion.Internal/FNV1A32.cs index 448cbbb89..d9209ea8a 100644 --- a/src/MagicOnion.Shared/Internal/FNV1A32.cs +++ b/src/MagicOnion.Internal/FNV1A32.cs @@ -2,7 +2,7 @@ namespace MagicOnion.Internal { - public static class FNV1A32 + internal static class FNV1A32 { public static int GetHashCode(string str) { diff --git a/src/MagicOnion.Shared/Internal/GrpcMethodHelper.cs b/src/MagicOnion.Internal/GrpcMethodHelper.cs similarity index 99% rename from src/MagicOnion.Shared/Internal/GrpcMethodHelper.cs rename to src/MagicOnion.Internal/GrpcMethodHelper.cs index feb3f934d..1d134de7a 100644 --- a/src/MagicOnion.Shared/Internal/GrpcMethodHelper.cs +++ b/src/MagicOnion.Internal/GrpcMethodHelper.cs @@ -7,7 +7,7 @@ namespace MagicOnion.Internal { - public static class GrpcMethodHelper + internal static class GrpcMethodHelper { public sealed class MagicOnionMethod { diff --git a/src/MagicOnion.Internal/MagicOnion.Internal.csproj b/src/MagicOnion.Internal/MagicOnion.Internal.csproj new file mode 100644 index 000000000..c4c204038 --- /dev/null +++ b/src/MagicOnion.Internal/MagicOnion.Internal.csproj @@ -0,0 +1,32 @@ + + + + netstandard2.0;netstandard2.1;net6.0 + + $(_LangVersionUnityBaseline) + enable + $(DefineConstants);NON_UNITY + + MagicOnion + + + false + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs b/src/MagicOnion.Internal/MagicOnionAsyncStreamReader.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/MagicOnionAsyncStreamReader.cs rename to src/MagicOnion.Internal/MagicOnionAsyncStreamReader.cs diff --git a/src/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs b/src/MagicOnion.Internal/MagicOnionClientStreamWriter.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/MagicOnionClientStreamWriter.cs rename to src/MagicOnion.Internal/MagicOnionClientStreamWriter.cs diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs b/src/MagicOnion.Internal/MagicOnionMarshallers.cs similarity index 83% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs rename to src/MagicOnion.Internal/MagicOnionMarshallers.cs index dda8b02da..6e93ee430 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Internal/MagicOnionMarshallers.cs +++ b/src/MagicOnion.Internal/MagicOnionMarshallers.cs @@ -7,7 +7,7 @@ namespace MagicOnion.Internal { // invoke from dynamic methods so must be public - public static class MagicOnionMarshallers + internal static class MagicOnionMarshallers { static readonly Type[] dynamicArgumentTupleTypes = typeof(DynamicArgumentTuple<,>).GetTypeInfo().Assembly .GetTypes() @@ -15,12 +15,6 @@ public static class MagicOnionMarshallers .OrderBy(x => x.GetGenericArguments().Length) .ToArray(); - static readonly Type[] dynamicArgumentTupleFormatterTypes = typeof(DynamicArgumentTupleFormatter<,,>).GetTypeInfo().Assembly - .GetTypes() - .Where(x => x.Name.StartsWith("DynamicArgumentTupleFormatter")) - .OrderBy(x => x.GetGenericArguments().Length) - .ToArray(); - public static readonly Marshaller ThroughMarshaller = new Marshaller(x => x, x => x); internal static Type CreateRequestType(ParameterInfo[] parameters) diff --git a/src/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs b/src/MagicOnion.Internal/MagicOnionServerStreamWriter.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/MagicOnionServerStreamWriter.cs rename to src/MagicOnion.Internal/MagicOnionServerStreamWriter.cs diff --git a/src/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs b/src/MagicOnion.Internal/Reflection/DynamicAssembly.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/Reflection/DynamicAssembly.cs rename to src/MagicOnion.Internal/Reflection/DynamicAssembly.cs diff --git a/src/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs b/src/MagicOnion.Internal/Reflection/ILGeneratorExtensions.cs similarity index 100% rename from src/MagicOnion.Shared/Internal/Reflection/ILGeneratorExtensions.cs rename to src/MagicOnion.Internal/Reflection/ILGeneratorExtensions.cs diff --git a/src/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.csproj b/src/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.csproj index 1a91dce6a..e4dd47093 100644 --- a/src/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.csproj +++ b/src/MagicOnion.Serialization.MemoryPack/MagicOnion.Serialization.MemoryPack.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/MagicOnion.Shared/DynamicArgumentTuple.cs b/src/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs similarity index 81% rename from src/MagicOnion.Shared/DynamicArgumentTuple.cs rename to src/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs index 5d5069c88..41cfbaa43 100644 --- a/src/MagicOnion.Shared/DynamicArgumentTuple.cs +++ b/src/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.cs @@ -4,28 +4,11 @@ using MessagePack; using MessagePack.Formatters; -namespace MagicOnion +namespace MagicOnion.Serialization.MessagePack { // T2 ~ T15 // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2) - { - Item1 = item1; - Item2 = item2; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -73,26 +56,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, Me return new DynamicArgumentTuple(item1, item2); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -147,29 +110,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReader reader return new DynamicArgumentTuple(item1, item2, item3); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -231,32 +171,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReader re return new DynamicArgumentTuple(item1, item2, item3, item4); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -325,35 +239,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackReade return new DynamicArgumentTuple(item1, item2, item3, item4, item5); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -429,38 +314,6 @@ public DynamicArgumentTuple Deserialize(ref MessagePackR return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -543,41 +396,6 @@ public DynamicArgumentTuple Deserialize(ref MessageP return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -667,44 +485,6 @@ public DynamicArgumentTuple Deserialize(ref Mess return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -801,47 +581,6 @@ public DynamicArgumentTuple Deserialize(ref return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -945,50 +684,6 @@ public DynamicArgumentTuple Deserialize return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1099,53 +794,6 @@ public DynamicArgumentTuple Deseri return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1263,56 +911,6 @@ public DynamicArgumentTuple D return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - [Key(12)] - public readonly T13 Item13; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - Item13 = item13; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1437,59 +1035,6 @@ public DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - [Key(12)] - public readonly T13 Item13; - [Key(13)] - public readonly T14 Item14; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - Item13 = item13; - Item14 = item14; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { @@ -1621,62 +1166,6 @@ public DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14); } } - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple - { - [Key(0)] - public readonly T1 Item1; - [Key(1)] - public readonly T2 Item2; - [Key(2)] - public readonly T3 Item3; - [Key(3)] - public readonly T4 Item4; - [Key(4)] - public readonly T5 Item5; - [Key(5)] - public readonly T6 Item6; - [Key(6)] - public readonly T7 Item7; - [Key(7)] - public readonly T8 Item8; - [Key(8)] - public readonly T9 Item9; - [Key(9)] - public readonly T10 Item10; - [Key(10)] - public readonly T11 Item11; - [Key(11)] - public readonly T12 Item12; - [Key(12)] - public readonly T13 Item13; - [Key(13)] - public readonly T14 Item14; - [Key(14)] - public readonly T15 Item15; - - [SerializationConstructor] - public DynamicArgumentTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10, T11 item11, T12 item12, T13 item13, T14 item14, T15 item15) - { - Item1 = item1; - Item2 = item2; - Item3 = item3; - Item4 = item4; - Item5 = item5; - Item6 = item6; - Item7 = item7; - Item8 = item8; - Item9 = item9; - Item10 = item10; - Item11 = item11; - Item12 = item12; - Item13 = item13; - Item14 = item14; - Item15 = item15; - } - } public class DynamicArgumentTupleFormatter : IMessagePackFormatter> { diff --git a/src/MagicOnion.Shared/DynamicArgumentTuple.tt b/src/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.tt similarity index 85% rename from src/MagicOnion.Shared/DynamicArgumentTuple.tt rename to src/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.tt index c4b0b3dbe..f164d4ad8 100644 --- a/src/MagicOnion.Shared/DynamicArgumentTuple.tt +++ b/src/MagicOnion.Serialization.MessagePack/DynamicArgumentTupleFormatter.tt @@ -11,7 +11,7 @@ using System.Runtime.InteropServices; using MessagePack; using MessagePack.Formatters; -namespace MagicOnion +namespace MagicOnion.Serialization.MessagePack { // T2 ~ T15 // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. @@ -22,24 +22,6 @@ namespace MagicOnion var defaultArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("T{0} default{0}", x))); var itemArgs = string.Join(", ", Enumerable.Range(1, i).Select(x => string.Format("item{0}", x))); #> - - [MessagePackObject] - [StructLayout(LayoutKind.Auto)] - public struct DynamicArgumentTuple<<#= typeArgs #>> - { -<# for(var j = 1; j <= i; j++) { #> - [Key(<#= j - 1 #>)] - public readonly T<#= j#> Item<#= j #>; -<# } #> - - [SerializationConstructor] - public DynamicArgumentTuple(<#= methodArgs #>) - { -<# for(var j = 1; j <= i; j++) { #> - Item<#= j#> = item<#= j #>; -<# } #> - } - } public class DynamicArgumentTupleFormatter<<#= typeArgs #>> : IMessagePackFormatter>> { diff --git a/src/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.csproj b/src/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.csproj new file mode 100644 index 000000000..1f602aaa5 --- /dev/null +++ b/src/MagicOnion.Serialization.MessagePack/MagicOnion.Serialization.MessagePack.csproj @@ -0,0 +1,38 @@ + + + + + netstandard2.0 + + enable + enable + + + MagicOnion.Serialization.MessagePack + MagicOnion extension package for serialization using MessagePack. + + + + + + + + + DynamicArgumentTupleFormatter.tt + True + True + + + + + + DynamicArgumentTupleFormatter.cs + TextTemplatingFileGenerator + + + + + + + + diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs b/src/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs similarity index 99% rename from src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs rename to src/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs index 8da58b1c3..76e0e9411 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/Serialization/MessagePackMagicOnionSerializerProvider.cs +++ b/src/MagicOnion.Serialization.MessagePack/MessagePackMagicOnionSerializerProvider.cs @@ -6,7 +6,7 @@ using MessagePack; using MessagePack.Formatters; -namespace MagicOnion.Serialization +namespace MagicOnion.Serialization.MessagePack { /// /// Provides a using MessagePack. diff --git a/src/MagicOnion.Shared/UnsafeDirectBlitResolver.cs b/src/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs similarity index 99% rename from src/MagicOnion.Shared/UnsafeDirectBlitResolver.cs rename to src/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs index 868fc3d0b..4dcefb943 100644 --- a/src/MagicOnion.Shared/UnsafeDirectBlitResolver.cs +++ b/src/MagicOnion.Serialization.MessagePack/UnsafeDirectBlitResolver.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace MagicOnion +namespace MagicOnion.Serialization.MessagePack { public class UnsafeDirectBlitResolver : IFormatterResolver { diff --git a/src/MagicOnion.Server.HttpGateway/MagicOnion.Server.HttpGateway.csproj b/src/MagicOnion.Server.HttpGateway/MagicOnion.Server.HttpGateway.csproj index 2912829a0..1234d92dc 100644 --- a/src/MagicOnion.Server.HttpGateway/MagicOnion.Server.HttpGateway.csproj +++ b/src/MagicOnion.Server.HttpGateway/MagicOnion.Server.HttpGateway.csproj @@ -24,6 +24,10 @@ + + + + diff --git a/src/MagicOnion.Server.Redis/MagicOnion.Server.Redis.csproj b/src/MagicOnion.Server.Redis/MagicOnion.Server.Redis.csproj index 52d2e821b..58975f5dc 100644 --- a/src/MagicOnion.Server.Redis/MagicOnion.Server.Redis.csproj +++ b/src/MagicOnion.Server.Redis/MagicOnion.Server.Redis.csproj @@ -18,6 +18,10 @@ + + + + diff --git a/src/MagicOnion.Server/MagicOnion.Server.csproj b/src/MagicOnion.Server/MagicOnion.Server.csproj index 50f33a00e..6aef23c98 100644 --- a/src/MagicOnion.Server/MagicOnion.Server.csproj +++ b/src/MagicOnion.Server/MagicOnion.Server.csproj @@ -13,6 +13,10 @@ MagicOnion server built on top of ASP.NET Core. $(MagicOnionPackageDescription) + + + + @@ -20,6 +24,7 @@ + diff --git a/src/MagicOnion.Server/MagicOnionOptions.cs b/src/MagicOnion.Server/MagicOnionOptions.cs index 0fad4616c..e227c3315 100644 --- a/src/MagicOnion.Server/MagicOnionOptions.cs +++ b/src/MagicOnion.Server/MagicOnionOptions.cs @@ -1,6 +1,7 @@ using MessagePack; using MagicOnion.Server.Filters; using MagicOnion.Serialization; +using MagicOnion.Serialization.MessagePack; namespace MagicOnion.Server; diff --git a/src/MagicOnion.Shared/MagicOnion.Shared.csproj b/src/MagicOnion.Shared/MagicOnion.Shared.csproj index 698eceb0f..c1cf71ecc 100644 --- a/src/MagicOnion.Shared/MagicOnion.Shared.csproj +++ b/src/MagicOnion.Shared/MagicOnion.Shared.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;netstandard2.1;net6.0 @@ -11,50 +11,8 @@ Provides shared classes and interfaces used by MagicOnion server and client. $(MagicOnionPackageDescription) - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + - - - - - TextTemplatingFileGenerator - DynamicArgumentTuple.cs - - - - - - - - - - True - True - DynamicArgumentTuple.tt - - - - - - $(ProjectDir)..\MagicOnion.Client.Unity\Assets\Scripts\MagicOnion\MagicOnion.Client\MagicOnion.Shared\ - - - - - - - - diff --git a/src/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs b/src/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs index 50f992aa5..aae908325 100644 --- a/src/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs +++ b/src/MagicOnion.Shared/Serialization/MagicOnionSerializer.cs @@ -1,32 +1,7 @@ -using System.Buffers; -using System.Reflection; -using Grpc.Core; +using MagicOnion.Serialization.MessagePack; namespace MagicOnion.Serialization { - /// - /// Provides a serializer for request/response of MagicOnion services and hub methods. - /// - public interface IMagicOnionSerializerProvider - { - /// - /// Create a serializer for the service method. - /// - /// gRPC method type of the method. - /// A method info for an implementation of the service method. It is a hint that handling request parameters on the server, which may be passed null on the client. - /// - IMagicOnionSerializer Create(MethodType methodType, MethodInfo? methodInfo); - } - - /// - /// Provides a processing for message serialization. - /// - public interface IMagicOnionSerializer - { - void Serialize(IBufferWriter writer, in T value); - T Deserialize(in ReadOnlySequence bytes); - } - /// /// Provides a serializer for request/response of MagicOnion services and hub methods. /// diff --git a/tests/MagicOnion.Shared.Tests/BoxTest.cs b/tests/MagicOnion.Abstractions.Tests/BoxTest.cs similarity index 97% rename from tests/MagicOnion.Shared.Tests/BoxTest.cs rename to tests/MagicOnion.Abstractions.Tests/BoxTest.cs index ef691a369..5f95e0f73 100644 --- a/tests/MagicOnion.Shared.Tests/BoxTest.cs +++ b/tests/MagicOnion.Abstractions.Tests/BoxTest.cs @@ -1,6 +1,6 @@ using MagicOnion.Internal; -namespace MagicOnion.Shared.Tests; +namespace MagicOnion.Abstractions.Tests; public class BoxTest { diff --git a/tests/MagicOnion.Shared.Tests/MagicOnion.Shared.Tests.csproj b/tests/MagicOnion.Abstractions.Tests/MagicOnion.Abstractions.Tests.csproj similarity index 100% rename from tests/MagicOnion.Shared.Tests/MagicOnion.Shared.Tests.csproj rename to tests/MagicOnion.Abstractions.Tests/MagicOnion.Abstractions.Tests.csproj diff --git a/tests/MagicOnion.Shared.Tests/UnaryResultNonGenericTest.cs b/tests/MagicOnion.Abstractions.Tests/UnaryResultNonGenericTest.cs similarity index 98% rename from tests/MagicOnion.Shared.Tests/UnaryResultNonGenericTest.cs rename to tests/MagicOnion.Abstractions.Tests/UnaryResultNonGenericTest.cs index c9b1011d3..4f278297a 100644 --- a/tests/MagicOnion.Shared.Tests/UnaryResultNonGenericTest.cs +++ b/tests/MagicOnion.Abstractions.Tests/UnaryResultNonGenericTest.cs @@ -1,6 +1,6 @@ using MagicOnion.Client; -namespace MagicOnion.Shared.Tests; +namespace MagicOnion.Abstractions.Tests; public class UnaryResultNonGenericTest { diff --git a/tests/MagicOnion.Shared.Tests/UnaryResultTest.cs b/tests/MagicOnion.Abstractions.Tests/UnaryResultTest.cs similarity index 98% rename from tests/MagicOnion.Shared.Tests/UnaryResultTest.cs rename to tests/MagicOnion.Abstractions.Tests/UnaryResultTest.cs index ef391aeac..6c59e6a8c 100644 --- a/tests/MagicOnion.Shared.Tests/UnaryResultTest.cs +++ b/tests/MagicOnion.Abstractions.Tests/UnaryResultTest.cs @@ -1,6 +1,6 @@ using MagicOnion.Client; -namespace MagicOnion.Shared.Tests; +namespace MagicOnion.Abstractions.Tests; public class UnaryResultTest { diff --git a/tests/MagicOnion.Shared.Tests/Usings.cs b/tests/MagicOnion.Abstractions.Tests/Usings.cs similarity index 100% rename from tests/MagicOnion.Shared.Tests/Usings.cs rename to tests/MagicOnion.Abstractions.Tests/Usings.cs diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Collector/SerializationInfoCollectorTest.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Collector/SerializationInfoCollectorTest.cs index b99a5b815..95f8db3d0 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Collector/SerializationInfoCollectorTest.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Collector/SerializationInfoCollectorTest.cs @@ -357,8 +357,8 @@ public void DynamicArgumentTuple() // Assert serializationInfoCollection.Should().NotBeNull(); serializationInfoCollection.Generics.Should().HaveCount(2); - serializationInfoCollection.Generics[0].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int64))"); - serializationInfoCollection.Generics[1].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32))"); + serializationInfoCollection.Generics[0].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int64))"); + serializationInfoCollection.Generics[1].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32))"); serializationInfoCollection.TypeHints.Should().HaveCount(5); // string, long, int, DynamicArgumentTuple, DynamicArgumentTuple } @@ -383,7 +383,7 @@ public void UserDefinedMessagePackSerializerFormattersNamespace() serializationInfoCollection.Enums.Should().BeEmpty(); serializationInfoCollection.Generics.Should().HaveCount(3); serializationInfoCollection.Generics[0].GetFormatterNameWithConstructorArgs().Should().Be("global::MessagePack.Formatters.NullableFormatter()"); - serializationInfoCollection.Generics[1].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int64))"); + serializationInfoCollection.Generics[1].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int64))"); serializationInfoCollection.Generics[2].GetFormatterNameWithConstructorArgs().Should().Be("global::MyFormatters.MyNamespace.MyGenericObjectFormatter()"); } @@ -407,7 +407,7 @@ public void UserDefinedMessagePackSerializerFormattersNamespace_NotSpecified() serializationInfoCollection.Enums.Should().BeEmpty(); serializationInfoCollection.Generics.Should().HaveCount(3); serializationInfoCollection.Generics[0].GetFormatterNameWithConstructorArgs().Should().Be("global::MessagePack.Formatters.NullableFormatter()"); - serializationInfoCollection.Generics[1].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int64))"); + serializationInfoCollection.Generics[1].GetFormatterNameWithConstructorArgs().Should().Be("global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int64))"); serializationInfoCollection.Generics[2].GetFormatterNameWithConstructorArgs().Should().Be("global::MessagePack.Formatters.MyNamespace.MyGenericObjectFormatter()"); } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/CompilationHelper.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/CompilationHelper.cs index ddc39b598..053beebe9 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/CompilationHelper.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/CompilationHelper.cs @@ -28,7 +28,8 @@ public static (Compilation Compilation, SemanticModel SemanticModel) Create(stri MetadataReference.CreateFromFile(typeof(MessagePack.MessagePackObjectAttribute).Assembly.Location), // MessagePack.Annotations MetadataReference.CreateFromFile(typeof(MagicOnion.IService<>).Assembly.Location), // MagicOnion.Abstractions MetadataReference.CreateFromFile(typeof(MagicOnion.Client.MagicOnionClient).Assembly.Location), // MagicOnion.Client - MetadataReference.CreateFromFile(typeof(MagicOnion.Internal.GrpcMethodHelper).Assembly.Location), // MagicOnion.Shared + MetadataReference.CreateFromFile(typeof(MagicOnion.Serialization.MagicOnionSerializerProvider).Assembly.Location), // MagicOnion.Shared + MetadataReference.CreateFromFile(typeof(MagicOnion.Serialization.MessagePack.MessagePackMagicOnionSerializerProvider).Assembly.Location), // MagicOnion.Serialization.MessagePack MetadataReference.CreateFromFile(typeof(IGreeterService).Assembly.Location), // SampleServiceDefinitions }; var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary); diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Nested/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Nested/0004_TempProject_MyServiceClient.g.cs index 06ca180d0..1903bf084 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Nested/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Nested/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter/0004_TempProject_MyServiceClient.g.cs index f146ca389..51c774b8e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter_Nullable/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter_Nullable/0004_TempProject_MyServiceClient.g.cs index 9775db605..67b7bc07e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter_Nullable/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Parameter_Nullable/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return/0004_TempProject_MyServiceClient.g.cs index d2587ba31..d95130d85 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return_Nullable/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return_Nullable/0004_TempProject_MyServiceClient.g.cs index b500350e4..42cd0080d 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return_Nullable/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateEnumFormatterTest/GenerateEnumFormatter_Return_Nullable/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs index 3cd919048..3f215c7c3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 8f169e623..da5defbc2 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 7db054812..3ff85ba8b 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs index a516b334d..b3087f131 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 1b9a65c84..36725eda8 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 81b8e8367..e0523a9c0 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs index be4f02d6f..e2b000fb3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs index 97872e2de..6269ae50f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs index c6287c834..338446145 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs index d6c944c32..671dfdd94 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs index b1ffc9b33..469f51796 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyGenericObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 14fcb0e88..1e0d0e3b2 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetStringValuesAsync(global::System.String[] arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 0db7f6389..d4d564120 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetValuesAsync(global::TempProject.MyResponse[] arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 52a205a2c..6f8ff1d94 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetStringValuesAsync(global::System.Collections.Generic.List arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs index cec5be0a5..efe54efeb 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetValuesAsync(global::System.Collections.Generic.List arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs index 30b6dbf50..16728fc25 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyGenericObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs index 553f23e6f..ee6736522 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyGenericObject> a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs index 68546d239..af905ee1b 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetValuesAsync(global::TempProject.MyGenericObject arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs index 6d5b0df15..fce0e6c50 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetEnumAsync(global::TempProject.MyGenericObject> arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs index 8f8abe625..0b2c0893a 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task> A() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 92aa30121..91f75663c 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetStringValuesAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 180a26a76..860cb3b9d 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task GetValuesAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs index 564582b47..d3dc1a9fc 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task> GetEnumAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 4a0f781dd..14b0ffac0 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task> GetStringValuesAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs index c11d138fb..5619401ae 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task> GetValuesAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs index 1f5ca3d02..81f4f205e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task> A() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs index 8cea2f4e0..5fbdbc3c1 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task>> A() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs index fb9c0a68f..81c4a5076 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task> GetValuesAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs index 8b22d6b25..5e7e0b036 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task>> GetEnumAsync() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/KnownFormatters/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/KnownFormatters/0003_TempProject_MyServiceClient.g.cs index 2c4bc0718..29c65e5a1 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/KnownFormatters/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/KnownFormatters/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -54,7 +48,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters/0003_TempProject_MyServiceClient.g.cs index 4d320953c..04aa94adc 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs index 159679144..1bee15c9e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -42,7 +36,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs index 7a9748b57..20a744998 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs index e61b90869..a8be1c35d 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -36,7 +30,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs index 488b0f732..7faaa1f6f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested/0003_TempProject_MyServiceClient.g.cs index a66603077..7a780fa81 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Array/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Array/0003_TempProject_MyServiceClient.g.cs index dd1c41b8f..859fc1a1f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Array/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Array/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Enum/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Enum/0004_TempProject_MyServiceClient.g.cs index 1274db022..9ce40e3f7 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Enum/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Parameters_Nested_Enum/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return/0003_TempProject_MyServiceClient.g.cs index 5415f183a..ccddbef7b 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -36,7 +30,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs index 8cdfbe99f..d42ba624e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -42,7 +36,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs index 6cec66f30..5486479fc 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ArrayFormatter_UserType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Enum/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Enum/0004_TempProject_MyServiceClient.g.cs index 7402d71ef..4def64aed 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Enum/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Enum/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs index c483af180..cf1ead7ce 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_KnownType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -36,7 +30,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs index a30ea80d8..9d8027d5f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_ListFormatter_UserType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_MultipleTypeArgs/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_MultipleTypeArgs/0003_TempProject_MyServiceClient.g.cs index d8d7b0cc9..9cde5c756 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_MultipleTypeArgs/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_MultipleTypeArgs/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -36,7 +30,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested/0003_TempProject_MyServiceClient.g.cs index 36c7f81ed..1e4f100f4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Array/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Array/0003_TempProject_MyServiceClient.g.cs index 52b9bffc3..b2b5448f8 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Array/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Array/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Enum/0004_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Enum/0004_TempProject_MyServiceClient.g.cs index b16722f25..caca822b5 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Enum/0004_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsTest/Return_Nested_Enum/0004_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateMemoryPackTest/Generic/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateMemoryPackTest/Generic/0001_MyApplication1_GreeterServiceClient.g.cs index 6a5f1d09b..224fd4a17 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateMemoryPackTest/Generic/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateMemoryPackTest/Generic/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0001_MyApplication1_GreeterServiceClient.g.cs index 7765f5892..3e979dfc3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs index 43bfda7f3..c87537d58 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableReferenceType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0001_MyApplication1_GreeterServiceClient.g.cs index bc4295173..1a635cf61 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs index 0e66d3e2a..2316e07d6 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateNullableTest/NullableValueType/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter>(default(global::System.String), default(global::System.Nullable)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter>(default(global::System.String), default(global::System.Nullable)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateRawStreamingTest/StreamingResult/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateRawStreamingTest/StreamingResult/0003_TempProject_MyServiceClient.g.cs index 7b4348c39..345784334 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateRawStreamingTest/StreamingResult/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateRawStreamingTest/StreamingResult/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_StreamingResult/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_StreamingResult/0003_TempProject_MyServiceClient.g.cs index 7b4348c39..345784334 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_StreamingResult/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_StreamingResult/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultNonGeneric/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultNonGeneric/0003_TempProject_MyServiceClient.g.cs index 5b6f5d3c0..0319bf3a3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultNonGeneric/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultNonGeneric/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfRefType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfRefType/0003_TempProject_MyServiceClient.g.cs index 6635b8c5c..015c6d7c2 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfRefType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfRefType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfT/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfT/0003_TempProject_MyServiceClient.g.cs index 49e73575d..b0e8429f4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfT/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfT/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfValueType/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfValueType/0003_TempProject_MyServiceClient.g.cs index f75e88038..eea2ee809 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfValueType/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateServiceTest/Return_UnaryResultOfValueType/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0001_TempProject_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0001_TempProject_MagicOnionInitializer_Resolver.g.cs index 24f673f85..4ecf3ccc8 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0001_TempProject_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0001_TempProject_MagicOnionInitializer_Resolver.g.cs @@ -60,8 +60,8 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::TempProject.MyObject), default(global::System.String), default(global::System.Int32)); - case 1: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::TempProject.MyObject), default(global::System.String)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::TempProject.MyObject), default(global::System.String), default(global::System.Int32)); + case 1: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::TempProject.MyObject), default(global::System.String)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs index 2090f3cbe..cab696332 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs index 1821232f8..f2503fd6a 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::TempProject.MyObject), default(global::System.Int32), default(global::System.String)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::TempProject.MyObject), default(global::System.Int32), default(global::System.String)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs index a9a6e0b92..f7a1ed9aa 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs index 253f3519a..684b0384f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs index 9caf0aa09..1c2df0ac4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs index e8362759a..ed61f4a33 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0001_TempProject_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32), default(global::System.Boolean)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32), default(global::System.Boolean)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs index 71c331c2b..7d74f14dd 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::System.String arg0, global::System.Int32 arg1, global::System.Boolean arg2) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs index 83c4fd6df..9e49654d4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::System.String arg0) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs index 76762f848..2087d3a83 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A() diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs index c271cc8df..f2908c80e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs index 6cf23242f..d198eb5b2 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs index 7755c51b9..5bd7a300b 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.ValueTask A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs index 228af774c..33e4ab9e4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.ValueTask A(global::TempProject.MyObject a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0001_MyApplication1_GreeterServiceClient.g.cs index 5fba9d3a1..648ee94dd 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs index 3ba8ea1ac..67ad3bcdb 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0001_MyApplication1_Net_Remoting_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0001_MyApplication1_Net_Remoting_GreeterServiceClient.g.cs index a692cecb8..d9208b065 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0001_MyApplication1_Net_Remoting_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0001_MyApplication1_Net_Remoting_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1.Net.Remoting { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -38,7 +32,7 @@ public MyApplication1_Net_Remoting_GreeterServiceClient(global::MagicOnion.Clien this.core = new ClientCore(serializerProvider); } - private MyApplication1_Net_Remoting_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_Net_Remoting_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0002_MyApplication1_Net_Remoting_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0002_MyApplication1_Net_Remoting_MagicOnionInitializer_Resolver.g.cs index 7f4496157..840febee8 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0002_MyApplication1_Net_Remoting_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/Generate_Namespace/0002_MyApplication1_Net_Remoting_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0002_MyNamespace_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0002_MyNamespace_MagicOnionInitializer_Resolver.g.cs index 511db91c5..6fdb51149 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0002_MyNamespace_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0002_MyNamespace_MagicOnionInitializer_Resolver.g.cs @@ -65,7 +65,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter, global::System.IO.FileMode, global::System.Linq.ILookup, global::System.Net.Http.ClientCertificateOption, global::System.Threading.ApartmentState, global::System.Threading.Tasks.TaskCreationOptions>(default(global::System.Int32), default(global::System.Collections.Generic.IReadOnlyList), default(global::System.IO.FileMode), default(global::System.Linq.ILookup), default(global::System.Net.Http.ClientCertificateOption), default(global::System.Threading.ApartmentState), default(global::System.Threading.Tasks.TaskCreationOptions)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter, global::System.IO.FileMode, global::System.Linq.ILookup, global::System.Net.Http.ClientCertificateOption, global::System.Threading.ApartmentState, global::System.Threading.Tasks.TaskCreationOptions>(default(global::System.Int32), default(global::System.Collections.Generic.IReadOnlyList), default(global::System.IO.FileMode), default(global::System.Linq.ILookup), default(global::System.Net.Http.ClientCertificateOption), default(global::System.Threading.ApartmentState), default(global::System.Threading.Tasks.TaskCreationOptions)); case 1: return new global::MessagePack.Formatters.InterfaceReadOnlyListFormatter(); case 2: return new global::MessagePack.Formatters.InterfaceLookupFormatter(); case 3: return new MessagePackEnumFormatters.FileModeFormatter(); diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0004_MyNamespace_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0004_MyNamespace_MyServiceClient.g.cs index d76e271a9..60e079651 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0004_MyNamespace_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateTest/ImplicitUsings_PropertyGroup_Enable/0004_MyNamespace_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyNamespace { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyNamespace_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private MyNamespace_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyNamespace_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_Service_Interface/0003_TempProject_MyServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_Service_Interface/0003_TempProject_MyServiceClient.g.cs index 49e73575d..b0e8429f4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_Service_Interface/0003_TempProject_MyServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_Service_Interface/0003_TempProject_MyServiceClient.g.cs @@ -5,12 +5,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOpt this.core = new ClientCore(serializerProvider); } - private TempProject_MyServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private TempProject_MyServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs index ef1a2861e..ea8deb923 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs @@ -7,12 +7,6 @@ namespace TempProject { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -20,13 +14,9 @@ static partial class MagicOnionGeneratedClient [global::MagicOnion.Ignore] public class TempProject_MyHubClient : global::MagicOnion.Client.StreamingHubClientBase, global::TempProject.IMyHub { - protected override global::Grpc.Core.Method DuplexStreamingAsyncMethod { get; } - public TempProject_MyHubClient(global::Grpc.Core.CallInvoker callInvoker, global::System.String host, global::Grpc.Core.CallOptions options, global::MagicOnion.Serialization.IMagicOnionSerializerProvider serializerProvider, global::MagicOnion.Client.IMagicOnionClientLogger logger) - : base(callInvoker, host, options, serializerProvider, logger) + : base("IMyHub", callInvoker, host, options, serializerProvider, logger) { - var marshaller = global::MagicOnion.Internal.MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new global::Grpc.Core.Method(global::Grpc.Core.MethodType.DuplexStreaming, "IMyHub", "Connect", marshaller, marshaller); } public global::System.Threading.Tasks.Task A(global::System.Int32 a) diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0001_MyApplication1_GreeterServiceClient.g.cs index 7765f5892..3e979dfc3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs index 43bfda7f3..c87537d58 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Default/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0001_MyApplication1_GreeterServiceClient.g.cs index 7765f5892..3e979dfc3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs index 43bfda7f3..c87537d58 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/DisableAutoRegistration/0002_MyApplication1_MagicOnionInitializer_Resolver.g.cs @@ -59,7 +59,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); default: return null; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0001__MagicOnionInitializer_Resolver.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0001__MagicOnionInitializer_Resolver.g.cs index 88d8b49aa..5979a4776 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0001__MagicOnionInitializer_Resolver.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0001__MagicOnionInitializer_Resolver.g.cs @@ -58,7 +58,7 @@ internal static object GetFormatter(global::System.Type t) switch (key) { - case 0: return new global::MagicOnion.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); + case 0: return new global::MagicOnion.Serialization.MessagePack.DynamicArgumentTupleFormatter(default(global::System.String), default(global::System.Int32)); case 1: return new global::__UserDefined__.MessagePack.Formatters.MyApplication1.MyGenericObjectFormatter(); default: return null; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0003_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0003_MyApplication1_GreeterServiceClient.g.cs index 77c36394a..420fd5546 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0003_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/MessagePackFormatterNamespace/0003_MyApplication1_GreeterServiceClient.g.cs @@ -3,12 +3,6 @@ #pragma warning disable CS0612 // 'member' is obsolete #pragma warning disable CS8019 // Unnecessary using directive. - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -32,7 +26,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Serializer_MemoryPack/0001_MyApplication1_GreeterServiceClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Serializer_MemoryPack/0001_MyApplication1_GreeterServiceClient.g.cs index 7765f5892..3e979dfc3 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Serializer_MemoryPack/0001_MyApplication1_GreeterServiceClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GeneratorOptionsTest/Serializer_MemoryPack/0001_MyApplication1_GreeterServiceClient.g.cs @@ -5,12 +5,6 @@ namespace MyApplication1 { - using global::System; - using global::Grpc.Core; - using global::MagicOnion; - using global::MagicOnion.Client; - using global::MessagePack; - partial class MagicOnionInitializer { static partial class MagicOnionGeneratedClient @@ -34,7 +28,7 @@ public MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionC this.core = new ClientCore(serializerProvider); } - private MyApplication1_GreeterServiceClient(MagicOnionClientOptions options, ClientCore core) : base(options) + private MyApplication1_GreeterServiceClient(global::MagicOnion.Client.MagicOnionClientOptions options, ClientCore core) : base(options) { this.core = core; } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Verifiers/MagicOnionSourceGeneratorVerifier.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Verifiers/MagicOnionSourceGeneratorVerifier.cs index 0ef0ccb5e..e886b7e33 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Verifiers/MagicOnionSourceGeneratorVerifier.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Verifiers/MagicOnionSourceGeneratorVerifier.cs @@ -103,7 +103,9 @@ void AddAdditionalReferences() // MagicOnion.Client this.TestState.AdditionalReferences.Add(typeof(MagicOnion.Client.MagicOnionClient).Assembly); // MagicOnion.Shared - this.TestState.AdditionalReferences.Add(typeof(MagicOnion.Internal.GrpcMethodHelper).Assembly); + this.TestState.AdditionalReferences.Add(typeof(MagicOnion.Serialization.MagicOnionSerializerProvider).Assembly); + // MagicOnion.Serialization.MessagePack + this.TestState.AdditionalReferences.Add(typeof(MagicOnion.Serialization.MessagePack.MessagePackMagicOnionSerializerProvider).Assembly); // MessagePack this.TestState.AdditionalReferences.Add(typeof(MessagePack.Formatters.IMessagePackFormatter).Assembly); // MessagePack.Annotations diff --git a/tests/MagicOnion.Integration.Tests/HandCraftedStreamingHubClientTest.cs b/tests/MagicOnion.Integration.Tests/HandCraftedStreamingHubClientTest.cs index 46f15cf46..6faf30602 100644 --- a/tests/MagicOnion.Integration.Tests/HandCraftedStreamingHubClientTest.cs +++ b/tests/MagicOnion.Integration.Tests/HandCraftedStreamingHubClientTest.cs @@ -64,10 +64,8 @@ public void OnMessage(int arg0, string arg1) class __HandCraftedClient__IHandCraftedStreamingHubClientTestHub : StreamingHubClientBase, IHandCraftedStreamingHubClientTestHub { public __HandCraftedClient__IHandCraftedStreamingHubClientTestHub(IHandCraftedStreamingHubClientTestHubReceiver receiver, CallInvoker callInvoker, string host, CallOptions option, IMagicOnionSerializerProvider messageSerializer, IMagicOnionClientLogger logger) - : base(callInvoker, host, option, messageSerializer, logger) + : base(nameof(IHandCraftedStreamingHubClientTestHub), callInvoker, host, option, messageSerializer, logger) { - var marshaller = MagicOnionMarshallers.ThroughMarshaller; - DuplexStreamingAsyncMethod = new Method(MethodType.DuplexStreaming, nameof(IHandCraftedStreamingHubClientTestHub), "Connect", marshaller, marshaller); } public Task ConnectAsync(IHandCraftedStreamingHubClientTestHubReceiver receiver) @@ -75,7 +73,6 @@ public Task ConnectAsync(IHandCraftedStreamingHubClientTestHubReceiver receiver) return __ConnectAndSubscribeAsync(receiver, CancellationToken.None); } - protected override Method DuplexStreamingAsyncMethod { get; } protected override void OnResponseEvent(int methodId, object taskCompletionSource, ArraySegment data) { if (FNV1A32.GetHashCode(nameof(MethodParameterless)) == methodId) diff --git a/tests/MagicOnion.Integration.Tests/MagicOnion.Integration.Tests.csproj b/tests/MagicOnion.Integration.Tests/MagicOnion.Integration.Tests.csproj index 1abe0e085..c2071e47e 100644 --- a/tests/MagicOnion.Integration.Tests/MagicOnion.Integration.Tests.csproj +++ b/tests/MagicOnion.Integration.Tests/MagicOnion.Integration.Tests.csproj @@ -24,6 +24,10 @@ + + + + diff --git a/tests/MagicOnion.Integration.Tests/SerializerUnaryTest.cs b/tests/MagicOnion.Integration.Tests/SerializerUnaryTest.cs index d15e6c6d9..b3081ee29 100644 --- a/tests/MagicOnion.Integration.Tests/SerializerUnaryTest.cs +++ b/tests/MagicOnion.Integration.Tests/SerializerUnaryTest.cs @@ -1,6 +1,7 @@ using Grpc.Net.Client; using MagicOnion.Client; using MagicOnion.Serialization; +using MagicOnion.Serialization.MessagePack; using MagicOnion.Server; using MagicOnionTestServer; using Microsoft.AspNetCore.Mvc.Testing; diff --git a/tests/MagicOnion.Serialization.MemoryPack.Tests/MemoryPackSerializerUnaryTest.cs b/tests/MagicOnion.Serialization.MemoryPack.Tests/MemoryPackSerializerUnaryTest.cs index ef504e882..5c5483f27 100644 --- a/tests/MagicOnion.Serialization.MemoryPack.Tests/MemoryPackSerializerUnaryTest.cs +++ b/tests/MagicOnion.Serialization.MemoryPack.Tests/MemoryPackSerializerUnaryTest.cs @@ -1,5 +1,6 @@ using Grpc.Net.Client; using MagicOnion.Client; +using MagicOnion.Serialization.MessagePack; using MagicOnion.Server; using MagicOnionTestServer; using MemoryPack; diff --git a/tests/MagicOnion.Serialization.MessagePack.Tests/GlobalUsings.cs b/tests/MagicOnion.Serialization.MessagePack.Tests/GlobalUsings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/tests/MagicOnion.Serialization.MessagePack.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/tests/MagicOnion.Serialization.MessagePack.Tests/MagicOnion.Serialization.MessagePack.Tests.csproj b/tests/MagicOnion.Serialization.MessagePack.Tests/MagicOnion.Serialization.MessagePack.Tests.csproj new file mode 100644 index 000000000..3683a53f8 --- /dev/null +++ b/tests/MagicOnion.Serialization.MessagePack.Tests/MagicOnion.Serialization.MessagePack.Tests.csproj @@ -0,0 +1,32 @@ + + + + net7.0 + enable + enable + + false + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + diff --git a/tests/MagicOnion.Shared.Tests/UnsafeDirectBlitResolverTest.cs b/tests/MagicOnion.Serialization.MessagePack.Tests/UnsafeDirectBlitResolverTest.cs similarity index 88% rename from tests/MagicOnion.Shared.Tests/UnsafeDirectBlitResolverTest.cs rename to tests/MagicOnion.Serialization.MessagePack.Tests/UnsafeDirectBlitResolverTest.cs index d7d24d1af..c9d065bc0 100644 --- a/tests/MagicOnion.Shared.Tests/UnsafeDirectBlitResolverTest.cs +++ b/tests/MagicOnion.Serialization.MessagePack.Tests/UnsafeDirectBlitResolverTest.cs @@ -1,6 +1,8 @@ +using FluentAssertions; +using MessagePack; using MessagePack.Resolvers; -namespace MagicOnion.Shared.Tests; +namespace MagicOnion.Serialization.MessagePack.Tests; public class UnsafeDirectBlitResolverTest { @@ -28,4 +30,4 @@ public struct MyStruct public int X; public int Y; public int Z; -} \ No newline at end of file +} diff --git a/tests/MagicOnion.Server.Tests/RawBytesResponseTest.cs b/tests/MagicOnion.Server.Tests/RawBytesResponseTest.cs index 0d1046aec..a02e28222 100644 --- a/tests/MagicOnion.Server.Tests/RawBytesResponseTest.cs +++ b/tests/MagicOnion.Server.Tests/RawBytesResponseTest.cs @@ -2,6 +2,7 @@ using Grpc.Net.Client; using MagicOnion.Client; using MagicOnion.Serialization; +using MagicOnion.Serialization.MessagePack; using MessagePack; using Microsoft.AspNetCore.Mvc.Testing; diff --git a/tests/MagicOnion.Server.Tests/StreamingHubHandlerTest.cs b/tests/MagicOnion.Server.Tests/StreamingHubHandlerTest.cs index 6eeb41bb5..9d4ef72b4 100644 --- a/tests/MagicOnion.Server.Tests/StreamingHubHandlerTest.cs +++ b/tests/MagicOnion.Server.Tests/StreamingHubHandlerTest.cs @@ -1,6 +1,7 @@ using System.Buffers; using Grpc.Core; using MagicOnion.Serialization; +using MagicOnion.Serialization.MessagePack; using MagicOnion.Server.Hubs; using MessagePack; using Microsoft.Extensions.DependencyInjection;