Skip to content

Commit b104538

Browse files
committed
Update samples to clarify specs. Related to issue #42, #45, #46, #47.
1 parent bcab797 commit b104538

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

samples/Samples/Sample01_BasicUsage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public void SerializeThenDeserialize()
7676
}
7777
}
7878

79+
// Note: If you want to interop with other platform using SerializationMethod.Array (default), you should use [MessagePackMember]. See Sample06 for details.
7980
public class PhotoEntry
8081
{
8182
public long Id { get; set; }

samples/Samples/Sample06_CustomAttributes.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Samples
3030
public class MessagePackMemberSample
3131
{
3232
[MessagePackMember(
33-
0, // Specify 0 based index for serialized array.
33+
0, // Specify 0 based index for serialized array. You should specify this value to ensure interoperability with other platform bindings.
3434
NilImplication = NilImplication.MemberDefault // Specify the behavior when unpacked value is nil -- default is Null for reference types (set null), Prohibit for value types (throw exception).
3535
)]
3636
public long FileId { get; set; }
@@ -49,7 +49,7 @@ public class MessagePackMemberSample
4949
// ... Or you can use DataMemberAttribute for compabitility among other libraries.
5050
public class DataContractSample
5151
{
52-
[DataMember( Name = "Id", Order = 1 )]
52+
[DataMember( Name = "Id", Order = 1 )] // Order can be used to interop too.
5353
public long Id { get; set; }
5454

5555
[DataMember( Name = "Title", Order = 2 )]
@@ -62,7 +62,7 @@ public class DataContractSample
6262

6363
namespace System.Runtime.Serialization
6464
{
65-
// Tips: You don't have to refer System.Runtime.Serialization assembly
65+
// Tips: You don't have to refer System.Runtime.Serialization assembly. MessagePack for CLI just see Type.FullName.
6666
public sealed class DataMemberAttribute : Attribute
6767
{
6868
public string Name { get; set; }

0 commit comments

Comments
 (0)