public void GenericFormatters() { var x = new GenericFormatterObject <int, string> { MyProperty1 = 999, MyProperty2 = "foobar" }; var r = Convert(x); r.MyProperty1.Is(999); r.MyProperty2.Is("foobar"); }
public void Serialize(ref MessagePackWriter writer, GenericFormatterObject <T1, T2> value, MessagePackSerializerOptions options) { writer.WriteArrayHeader(2); options.Resolver.GetFormatterWithVerify <T1>().Serialize(ref writer, value.MyProperty1, options); options.Resolver.GetFormatterWithVerify <T2>().Serialize(ref writer, value.MyProperty2, options); }