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

Fixed a bug in CSharp SampleUsage.
pull/994/head
Jan Tattermusch 9 years ago
commit 956a770adc
  1. 7
      csharp/src/AddressBook/SampleUsage.cs

@ -56,8 +56,11 @@ namespace Google.Protobuf.Examples.AddressBook
}
Person copy = Person.Parser.ParseFrom(bytes);
// A more streamlined approach might look like this:
bytes = copy.ToByteArray();
AddressBook book = new AddressBook
{
People = { copy }
};
bytes = book.ToByteArray();
// And read the address book back again
AddressBook restored = AddressBook.Parser.ParseFrom(bytes);
// The message performs a deep-comparison on equality:

Loading…
Cancel
Save