protocol buffers - ServiceStack ProtoBuff Serialization to custom stream -
protocol buffers - ServiceStack ProtoBuff Serialization to custom stream -
a few days ago posted question serializing responsestatus property binaryformatter. mythz pointed out wasnt fastest way go, decided switch formatter. tried protobuff , msgpack, , on protobuf now.
my real question is: im trying grasp how protobuf knows how servicestack dto's should serialized. tried adding possible attributes existing dto, protocontract , protomember(0,1,2,3,etc), datacontract , datamember.
on top of dont utilize servicestack's own client, seek serialize request existing stream.
if dont this:
servicestack.protobuf.protobufformat.model.add (typeof(namespaceplaceholder.service.dto.getnodes), false);
i error types , contracts cannot infered, if add together piece of code, continues great, deserialized object empty.
im using serialize:
servicestack.protobuf.protobufformat.model.serialize (ms, myobject);
and deserialize:
servicestack.protobuf.protobufformat.model.deserialize (ms, null, deserializationtype);
i think im missing here. have namespaces? looked code servicestack.protobuff, isnt hard understand, cannot going.
things unclear me now:
is there need add together attributes existing dto's ? (in protobuf v2 can in code, read, can alter existing dto's) do need initialize request(and response) dto's, in client(serialize) wel in server(deserialize) is there reason why should not serializing own stream ?many thanks,
i hate post reply myself, means havent searched plenty in first place
i learned next attributes important:
[protocontract] [protomember(x)] [protoinclude(x,typeof(derivingclass))]for learned new: why class inheritance in dto's not advisable.
i've got going now, , seek create real-life friendly..
servicestack protocol-buffers
Comments
Post a Comment