Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IBufferWriter<byte> overload to NonGeneric API #718

Closed
neuecc opened this issue Dec 12, 2019 · 1 comment
Closed

Add IBufferWriter<byte> overload to NonGeneric API #718

neuecc opened this issue Dec 12, 2019 · 1 comment
Assignees
Milestone

Comments

@neuecc
Copy link
Member

neuecc commented Dec 12, 2019

I'm trying to support BodyWriter in netcoreapp3.0 to AspNetCoreMvcFormatter.
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/request-response?view=aspnetcore-3.1

This code will become following.

#if NETSTANDARD2_0
return MessagePackSerializer.SerializeAsync(context.ObjectType, context.HttpContext.Response.Body, context.Object, this.options, context.HttpContext.RequestAborted);
#else
await MessagePackSerializer.SerializeAsync(context.ObjectType, context.HttpContext.Response.BodyWriter, context.Object, this.options, context.HttpContext.RequestAborted);
#endif

But currently NonGeneric API does not covered full Generic APIs so cannot implement it.

@AArnott AArnott self-assigned this Dec 12, 2019
@AArnott AArnott added this to the v2.0 milestone Dec 12, 2019
@AArnott AArnott changed the title NonGeneric API does not covered IBufferWriter overload. Add IBufferWriter<byte> overload to NonGeneric API Dec 12, 2019
@AArnott
Copy link
Collaborator

AArnott commented Dec 12, 2019

There is a MessagePackWriter overload in the non-generic API, FWIW. So you can make it work today simply by wrapping the IBufferWriter<T> in one of those first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants