Could go either way. If you need to to encode protobuf data into a text format: use base-64, which conveniently doesn't use |
/ [
/ ]
.
If you prefer to protobuf-encode objects that aren't currently attributed, there are ways to do that too: if the types from the database are generated as partial
classes, then at the simplest you can just do (in another code file):
namespace The.Same.Namespace {
[ProtoContract]
[ProtoPartialMember(1, "Foo")]
[ProtoPartialMember(2, "Bar")]
...
partial class SomeEntity {}
}
where Foo
and Bar
are members you want serialized. Or alternatively, you can configure the entire model at runtime:
RuntimeTypeModel.Default.Add(typeof(SomeEntity), false).Add("Foo", "Bar");
(that is a very basic configuration; much more subtle options are available)