Skip to content

Commit c1da541

Browse files
committed
Add document to clarify #212.
1 parent b25f336 commit c1da541

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/MsgPack/Serialization/MessagePackSerializer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ public void PackTo( Packer packer, object objectTree )
114114
/// <returns>
115115
/// The deserialized object.
116116
/// </returns>
117+
/// <remarks>
118+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
119+
/// Or, you will get a default value of the object.
120+
/// </remarks>
117121
/// <seealso cref="Capabilities" />
118122
public object UnpackFrom( Unpacker unpacker )
119123
{
@@ -229,6 +233,10 @@ public Task PackToAsync( Packer packer, object objectTree, CancellationToken can
229233
/// <exception cref="NotSupportedException">
230234
/// The type of deserializing is not serializable even if it can be serialized.
231235
/// </exception>
236+
/// <remarks>
237+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
238+
/// Or, you will get a default value of the object.
239+
/// </remarks>
232240
/// <seealso cref="Capabilities"/>
233241
public Task<object> UnpackFromAsync( Unpacker unpacker, CancellationToken cancellationToken )
234242
{

src/MsgPack/Serialization/MessagePackSerializer`1.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ protected internal virtual Task PackToAsyncCore( Packer packer, T objectTree, Ca
483483
/// <exception cref="NotSupportedException">
484484
/// <typeparamref name="T"/> is not serializable even if it can be serialized.
485485
/// </exception>
486+
/// <remarks>
487+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
488+
/// Or, you will get a default value of <typeparamref name="T"/>.
489+
/// </remarks>
486490
/// <seealso cref="P:Capabilities"/>
487491
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "False positive because never reached." )]
488492
public new T UnpackFrom( Unpacker unpacker )
@@ -574,6 +578,10 @@ protected internal virtual T UnpackNil()
574578
/// <exception cref="NotSupportedException">
575579
/// <typeparamref name="T"/> is not serializable even if it can be serialized.
576580
/// </exception>
581+
/// <remarks>
582+
/// You must call <see cref="Unpacker.Read()"/> at least once in advance.
583+
/// Or, you will get a default value of <typeparamref name="T"/>.
584+
/// </remarks>
577585
/// <seealso cref="P:Capabilities"/>
578586
public Task<T> UnpackFromAsync( Unpacker unpacker )
579587
{

0 commit comments

Comments
 (0)