Commit 956a770a authored by Jan Tattermusch's avatar Jan Tattermusch

Merge pull request #988 from gabikliot/CSharp-SampleUsage-Big-Fix

Fixed a bug in CSharp SampleUsage.
parents 562372e5 bdec9907
...@@ -56,8 +56,11 @@ namespace Google.Protobuf.Examples.AddressBook ...@@ -56,8 +56,11 @@ namespace Google.Protobuf.Examples.AddressBook
} }
Person copy = Person.Parser.ParseFrom(bytes); Person copy = Person.Parser.ParseFrom(bytes);
// A more streamlined approach might look like this: AddressBook book = new AddressBook
bytes = copy.ToByteArray(); {
People = { copy }
};
bytes = book.ToByteArray();
// And read the address book back again // And read the address book back again
AddressBook restored = AddressBook.Parser.ParseFrom(bytes); AddressBook restored = AddressBook.Parser.ParseFrom(bytes);
// The message performs a deep-comparison on equality: // The message performs a deep-comparison on equality:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment