Skip to content

Commit 3915c4e

Browse files
committed
Add document to clarify #212.
1 parent d8b65b8 commit 3915c4e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/MsgPack/Serialization/MessagePackSerializer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ public void PackTo( Packer packer, object objectTree )
120120
/// <returns>
121121
/// The deserialized object.
122122
/// </returns>
123+
/// <remarks>
124+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
125+
/// Or, you will get a default value of the object.
126+
/// </remarks>
123127
/// <seealso cref="Capabilities" />
124128
public object UnpackFrom( Unpacker unpacker )
125129
{
@@ -235,6 +239,10 @@ public Task PackToAsync( Packer packer, object objectTree, CancellationToken can
235239
/// <exception cref="NotSupportedException">
236240
/// The type of deserializing is not serializable even if it can be serialized.
237241
/// </exception>
242+
/// <remarks>
243+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
244+
/// Or, you will get a default value of the object.
245+
/// </remarks>
238246
/// <seealso cref="Capabilities"/>
239247
public Task<object> UnpackFromAsync( Unpacker unpacker, CancellationToken cancellationToken )
240248
{

src/MsgPack/Serialization/MessagePackSerializer`1.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,10 @@ protected internal virtual Task PackToAsyncCore( Packer packer, T objectTree, Ca
491491
/// <exception cref="NotSupportedException">
492492
/// <typeparamref name="T"/> is not serializable even if it can be serialized.
493493
/// </exception>
494+
/// <remarks>
495+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
496+
/// Or, you will get a default value of <typeparamref name="T"/>.
497+
/// </remarks>
494498
/// <seealso cref="P:Capabilities"/>
495499
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "False positive because never reached." )]
496500
public new T UnpackFrom( Unpacker unpacker )
@@ -582,6 +586,10 @@ protected internal virtual T UnpackNil()
582586
/// <exception cref="NotSupportedException">
583587
/// <typeparamref name="T"/> is not serializable even if it can be serialized.
584588
/// </exception>
589+
/// <remarks>
590+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
591+
/// Or, you will get a default value of <typeparamref name="T"/>.
592+
/// </remarks>
585593
/// <seealso cref="P:Capabilities"/>
586594
public Task<T> UnpackFromAsync( Unpacker unpacker )
587595
{

0 commit comments

Comments
 (0)