如何在打开的API代理工具中处理流输入/输出

发布于 2025-02-07 00:20:52 字数 450 浏览 3 评论 0原文

[HttpGet]
public ActionResult<Stream> ReadStreamFromFile(string fileNameWithFullPath)
{
    byte[] byteArray = System.IO.File.ReadAllBytes(fileNameWithFullPath);                    
    System.IO.MemoryStream memoryStream = new MemoryStream(byteArray);
    return memoryStream;
}

当我尝试使用nswag和Microsoft编码支持的DLL创建代理时,流是创建一类复杂类型而不是简单类型的类,这会在尝试调用服务时在运行时遇到问题。

代理生成设置有什么方法将其称为io.stream而不是.stream?

请建议。 阿玛

[HttpGet]
public ActionResult<Stream> ReadStreamFromFile(string fileNameWithFullPath)
{
    byte[] byteArray = System.IO.File.ReadAllBytes(fileNameWithFullPath);                    
    System.IO.MemoryStream memoryStream = new MemoryStream(byteArray);
    return memoryStream;
}

When I trying to create proxy using NSWAg and Microsoft CodeDOM supported DLLs, Stream is created a class of complex type instead of simple type, which causes getting issues at runtime, when trying to calling service.

Is there any way in proxy generation setting to refer it as IO.Stream instead of .Stream?

Please suggest.
amaR

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文