You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// An <see cref="IResult"/> that serializes a value to MessagePack format and writes it to the HTTP response.
17
17
/// </summary>
18
-
/// <typeparam name="TValue">The type of the value to serialize.</typeparam>
19
-
publicclassMessagePackResult<TValue>:
18
+
/// <remarks>
19
+
/// <para>
20
+
/// This class provides a way to return MessagePack-serialized responses from ASP.NET Core minimal API endpoints.
21
+
/// MessagePack is a binary serialization format that is typically faster and more compact than JSON.
22
+
/// </para>
23
+
/// <para>
24
+
/// The class automatically handles null values by returning a 204 No Content response, and supports
25
+
/// explicit type specification for serialization scenarios where the runtime type differs from the desired
26
+
/// serialization type. This is particularly useful with collection initializers or when serializing
27
+
/// derived types as their base type or interface.
28
+
/// </para>
29
+
/// <para>
30
+
/// When used in minimal API endpoints, this class implements <see cref="IEndpointMetadataProvider"/>
31
+
/// to automatically populate OpenAPI metadata for proper API documentation.
32
+
/// </para>
33
+
/// </remarks>
34
+
publicclassMessagePackResult:
20
35
IResult,
21
36
IValueHttpResult,
22
-
IValueHttpResult<TValue>,
23
37
IStatusCodeHttpResult,
24
38
IContentTypeHttpResult,
25
39
IEndpointMetadataProvider
26
40
{
27
41
/// <summary>
28
-
/// Initializes a new instance of the <see cref="MessagePackResult{TValue}"/> class.
42
+
/// Initializes a new instance of the <see cref="MessagePackResult"/> class.
29
43
/// </summary>
30
44
/// <param name="value">The value to serialize. If <c>null</c>, a 204 No Content response is returned.</param>
31
45
/// <param name="statusCode">The HTTP status code. If not specified, defaults to 200 OK for non-null values and 204 No Content for null values.</param>
32
46
/// <param name="contentType">The content type. If not specified, defaults to the MessagePack content type.</param>
0 commit comments