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.Client/MagicOnion.Shared/DynamicArgumentTuple.cs index 92f0ec57c..2768748d3 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/DynamicArgumentTuple.cs @@ -5,7 +5,8 @@ namespace MagicOnion { - // T2 ~ T20 + // T2 ~ T15 + // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. [MessagePackObject] @@ -1799,1119 +1800,4 @@ public DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15); } } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - - [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, T16 item16) - { - 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; - Item16 = item16; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(16); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - - [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, T16 item16, T17 item17) - { - 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; - Item16 = item16; - Item17 = item17; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(17); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - [Key(17)] - public readonly T18 Item18; - - [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, T16 item16, T17 item17, T18 item18) - { - 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; - Item16 = item16; - Item17 = item17; - Item18 = item18; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - readonly T18 default18; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17, T18 default18) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - this.default18 = default18; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(18); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item18, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - var item18 = default18; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 17: - item18 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - [Key(17)] - public readonly T18 Item18; - [Key(18)] - public readonly T19 Item19; - - [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, T16 item16, T17 item17, T18 item18, T19 item19) - { - 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; - Item16 = item16; - Item17 = item17; - Item18 = item18; - Item19 = item19; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - readonly T18 default18; - readonly T19 default19; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17, T18 default18, T19 default19) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - this.default18 = default18; - this.default19 = default19; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(19); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item18, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item19, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - var item18 = default18; - var item19 = default19; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 17: - item18 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 18: - item19 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - [Key(17)] - public readonly T18 Item18; - [Key(18)] - public readonly T19 Item19; - [Key(19)] - public readonly T20 Item20; - - [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, T16 item16, T17 item17, T18 item18, T19 item19, T20 item20) - { - 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; - Item16 = item16; - Item17 = item17; - Item18 = item18; - Item19 = item19; - Item20 = item20; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - readonly T18 default18; - readonly T19 default19; - readonly T20 default20; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17, T18 default18, T19 default19, T20 default20) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - this.default18 = default18; - this.default19 = default19; - this.default20 = default20; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(20); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item18, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item19, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item20, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - var item18 = default18; - var item19 = default19; - var item20 = default20; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 17: - item18 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 18: - item19 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 19: - item20 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19, item20); - } - } } \ No newline at end of file diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MagicOnionMarshallers.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MagicOnionMarshallers.cs index 7bbe8349d..72a83ebbd 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MagicOnionMarshallers.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Shared/MagicOnionMarshallers.cs @@ -39,9 +39,9 @@ internal static Type CreateRequestType(ParameterInfo[] parameters) var t = parameters[0].ParameterType; return t; } - else if (parameters.Length > 20) + else if (parameters.Length >= 16) { - throw new InvalidOperationException($"Parameter length must be <= 20, length:{parameters.Length}"); + throw new InvalidOperationException($"The method '{parameters[0].Member.DeclaringType.FullName}.{parameters[0].Member.Name}' must have less than 16 parameters. (Length: {parameters.Length})"); } else { @@ -62,9 +62,9 @@ public static Type CreateRequestTypeAndSetResolver(string path, ParameterInfo[] { return parameters[0].ParameterType; } - else if (parameters.Length > 20) + else if (parameters.Length >= 16) { - throw new InvalidOperationException($"Parameter length must be <= 20, path:{path} length:{parameters.Length}"); + throw new InvalidOperationException($"The method '{parameters[0].Member.DeclaringType.FullName}.{parameters[0].Member.Name}' must have less than 16 parameters. (Length: {parameters.Length})"); } else { diff --git a/src/MagicOnion.Shared/DynamicArgumentTuple.cs b/src/MagicOnion.Shared/DynamicArgumentTuple.cs index 92f0ec57c..2768748d3 100644 --- a/src/MagicOnion.Shared/DynamicArgumentTuple.cs +++ b/src/MagicOnion.Shared/DynamicArgumentTuple.cs @@ -5,7 +5,8 @@ namespace MagicOnion { - // T2 ~ T20 + // T2 ~ T15 + // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. [MessagePackObject] @@ -1799,1119 +1800,4 @@ public DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15); } } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - - [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, T16 item16) - { - 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; - Item16 = item16; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(16); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - - [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, T16 item16, T17 item17) - { - 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; - Item16 = item16; - Item17 = item17; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(17); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - [Key(17)] - public readonly T18 Item18; - - [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, T16 item16, T17 item17, T18 item18) - { - 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; - Item16 = item16; - Item17 = item17; - Item18 = item18; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - readonly T18 default18; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17, T18 default18) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - this.default18 = default18; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(18); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item18, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - var item18 = default18; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 17: - item18 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - [Key(17)] - public readonly T18 Item18; - [Key(18)] - public readonly T19 Item19; - - [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, T16 item16, T17 item17, T18 item18, T19 item19) - { - 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; - Item16 = item16; - Item17 = item17; - Item18 = item18; - Item19 = item19; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - readonly T18 default18; - readonly T19 default19; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17, T18 default18, T19 default19) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - this.default18 = default18; - this.default19 = default19; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(19); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item18, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item19, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - var item18 = default18; - var item19 = default19; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 17: - item18 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 18: - item19 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19); - } - } - - [MessagePackObject] - 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; - [Key(15)] - public readonly T16 Item16; - [Key(16)] - public readonly T17 Item17; - [Key(17)] - public readonly T18 Item18; - [Key(18)] - public readonly T19 Item19; - [Key(19)] - public readonly T20 Item20; - - [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, T16 item16, T17 item17, T18 item18, T19 item19, T20 item20) - { - 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; - Item16 = item16; - Item17 = item17; - Item18 = item18; - Item19 = item19; - Item20 = item20; - } - } - - public class DynamicArgumentTupleFormatter : IMessagePackFormatter> - { - readonly T1 default1; - readonly T2 default2; - readonly T3 default3; - readonly T4 default4; - readonly T5 default5; - readonly T6 default6; - readonly T7 default7; - readonly T8 default8; - readonly T9 default9; - readonly T10 default10; - readonly T11 default11; - readonly T12 default12; - readonly T13 default13; - readonly T14 default14; - readonly T15 default15; - readonly T16 default16; - readonly T17 default17; - readonly T18 default18; - readonly T19 default19; - readonly T20 default20; - - public DynamicArgumentTupleFormatter(T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10, T11 default11, T12 default12, T13 default13, T14 default14, T15 default15, T16 default16, T17 default17, T18 default18, T19 default19, T20 default20) - { - this.default1 = default1; - this.default2 = default2; - this.default3 = default3; - this.default4 = default4; - this.default5 = default5; - this.default6 = default6; - this.default7 = default7; - this.default8 = default8; - this.default9 = default9; - this.default10 = default10; - this.default11 = default11; - this.default12 = default12; - this.default13 = default13; - this.default14 = default14; - this.default15 = default15; - this.default16 = default16; - this.default17 = default17; - this.default18 = default18; - this.default19 = default19; - this.default20 = default20; - } - - public void Serialize(ref MessagePackWriter writer, DynamicArgumentTuple value, MessagePackSerializerOptions options) - { - writer.WriteArrayHeader(20); - var resolver = options.Resolver; - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item10, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item11, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item12, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item13, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item14, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item15, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item16, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item17, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item18, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item19, options); - resolver.GetFormatterWithVerify().Serialize(ref writer, value.Item20, options); - } - - public DynamicArgumentTuple Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - { - var resolver = options.Resolver; - var length = reader.ReadArrayHeader(); - - var item1 = default1; - var item2 = default2; - var item3 = default3; - var item4 = default4; - var item5 = default5; - var item6 = default6; - var item7 = default7; - var item8 = default8; - var item9 = default9; - var item10 = default10; - var item11 = default11; - var item12 = default12; - var item13 = default13; - var item14 = default14; - var item15 = default15; - var item16 = default16; - var item17 = default17; - var item18 = default18; - var item19 = default19; - var item20 = default20; - - for (var i = 0; i < length; i++) - { - switch (i) - { - case 0: - item1 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 1: - item2 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - item3 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 3: - item4 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - item5 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - item6 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - item7 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - item8 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - item9 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 9: - item10 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 10: - item11 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 11: - item12 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 12: - item13 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 13: - item14 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 14: - item15 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 15: - item16 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 16: - item17 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 17: - item18 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 18: - item19 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 19: - item20 = resolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - return new DynamicArgumentTuple(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18, item19, item20); - } - } } \ No newline at end of file diff --git a/src/MagicOnion.Shared/DynamicArgumentTuple.tt b/src/MagicOnion.Shared/DynamicArgumentTuple.tt index 83cc6092d..4e3bad4a0 100644 --- a/src/MagicOnion.Shared/DynamicArgumentTuple.tt +++ b/src/MagicOnion.Shared/DynamicArgumentTuple.tt @@ -12,9 +12,10 @@ using MessagePack.Formatters; namespace MagicOnion { - // T2 ~ T20 + // T2 ~ T15 + // NOTE: Blazor WebAssembly (AOT) does not support more than 16 generic type parameters. -<# for(var i = 2; i <= 20; i++) { +<# 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))); diff --git a/src/MagicOnion.Shared/MagicOnionMarshallers.cs b/src/MagicOnion.Shared/MagicOnionMarshallers.cs index 7bbe8349d..72a83ebbd 100644 --- a/src/MagicOnion.Shared/MagicOnionMarshallers.cs +++ b/src/MagicOnion.Shared/MagicOnionMarshallers.cs @@ -39,9 +39,9 @@ internal static Type CreateRequestType(ParameterInfo[] parameters) var t = parameters[0].ParameterType; return t; } - else if (parameters.Length > 20) + else if (parameters.Length >= 16) { - throw new InvalidOperationException($"Parameter length must be <= 20, length:{parameters.Length}"); + throw new InvalidOperationException($"The method '{parameters[0].Member.DeclaringType.FullName}.{parameters[0].Member.Name}' must have less than 16 parameters. (Length: {parameters.Length})"); } else { @@ -62,9 +62,9 @@ public static Type CreateRequestTypeAndSetResolver(string path, ParameterInfo[] { return parameters[0].ParameterType; } - else if (parameters.Length > 20) + else if (parameters.Length >= 16) { - throw new InvalidOperationException($"Parameter length must be <= 20, path:{path} length:{parameters.Length}"); + throw new InvalidOperationException($"The method '{parameters[0].Member.DeclaringType.FullName}.{parameters[0].Member.Name}' must have less than 16 parameters. (Length: {parameters.Length})"); } else { diff --git a/tests/MagicOnion.Server.Tests/Tests/DynamicArgumentTupleTest.cs b/tests/MagicOnion.Server.Tests/Tests/DynamicArgumentTupleTest.cs new file mode 100644 index 000000000..bb3a04f89 --- /dev/null +++ b/tests/MagicOnion.Server.Tests/Tests/DynamicArgumentTupleTest.cs @@ -0,0 +1,83 @@ +using Grpc.Core; +using FluentAssertions; +using MagicOnion.Client; +using MagicOnion.Server; +using MessagePack; +using System; +using System.Linq; +using System.Threading; +using System.Threading.Channels; +using System.Threading.Tasks; +using Grpc.Net.Client; +using Xunit; +using Xunit.Abstractions; + +namespace MagicOnion.Server.Tests +{ + public interface IMaxArgCountExcessDynamicArgumentTupleService : IService + { + // T0 - T15 (TypeParams = 16) + UnaryResult Unary1(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12, int arg13, int arg14, int arg15); + } + + public class MaxArgCountExcessDynamicArgumentTupleService : ServiceBase, IMaxArgCountExcessDynamicArgumentTupleService + { + public UnaryResult Unary1(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12, int arg13, int arg14, int arg15) + { + return ReturnNil(); + } + } + + public class MaxArgCountExcessDynamicArgumentTupleServiceTest : IClassFixture> + { + ITestOutputHelper logger; + GrpcChannel channel; + + public MaxArgCountExcessDynamicArgumentTupleServiceTest(ITestOutputHelper logger, ServerFixture server) + { + this.logger = logger; + this.channel = server.DefaultChannel; + } + + [Fact] + public async Task Unary1() + { + var ex = Assert.Throws(() => MagicOnionClient.Create(channel)); + ex.InnerException.Should().BeOfType(); + } + } + + public interface IDynamicArgumentTupleService : IService + { + // T0 - T14 (TypeParams = 15) + UnaryResult Unary1(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12, int arg13, int arg14); + } + + public class DynamicArgumentTupleService : ServiceBase, IDynamicArgumentTupleService + { + public UnaryResult Unary1(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12, int arg13, int arg14) + { + return UnaryResult(arg0 + arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14); + } + } + + public class DynamicArgumentTupleServiceTest : IClassFixture> + { + ITestOutputHelper logger; + GrpcChannel channel; + + public DynamicArgumentTupleServiceTest(ITestOutputHelper logger, ServerFixture server) + { + this.logger = logger; + this.channel = server.DefaultChannel; + } + + [Fact] + public async Task Unary1() + { + var client = MagicOnionClient.Create(channel); + var result = await client.Unary1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + result.Should().Be(120); + } + } +}