protected WampEventValueTupleConverter() { Type tupleType = typeof(TTuple); if (!tupleType.IsValueTuple()) { throw new ArgumentException("Expected TTuple to be a ValueTuple"); } if (!tupleType.IsValidTupleType()) { throw new ArgumentException("TTuple is an invalid ValueTuple. Expected TRest to be a ValueTuple."); } mArrayConverter = ValueTupleArrayConverter <TTuple> .Value; Type converterType = GetConverterType(); ValidateConverterType(converterType); IList <string> transformNames = GetTransformNames(converterType); int tupleLength = tupleType.GetValueTupleLength(); ValidateTransformNames(transformNames, tupleLength); if (transformNames != null) { if (transformNames.Take(tupleLength).All(x => x != null)) { mDictionaryConverter = ValueTupleDictionaryConverterBuilder.Build(tupleType, transformNames); } } mArgumentUnpacker = ArgumentUnpackerHelper.GetValueTupleArgumentUnpacker (tupleType, transformNames); }
public ValueTupleValueExtractor(ArgumentUnpacker unpacker) { mUnpacker = unpacker; mConverter = ValueTupleArrayConverter <T> .Value; }
public PositionalTupleExtractor(Type tupleType) { mConverter = ValueTupleArrayConverter.Get(tupleType); }