FubuMVC:如何在控制器上创建零模型输出操作?

发布于 2024-10-02 14:41:11 字数 206 浏览 1 评论 0原文

在 FubuMVC 中,当我希望控制器操作方法返回 json 结果时,我在该方法上使用 JsonEndpoint 属性。但是,我没有看到 void 方法的相应属性。

对于特定操作,我不想返回任何内容,但如果我有一个 void 返回结果 Fubu 会失败,因为它开始寻找与空模型匹配的视图。

是否有属性或简单的更改允许特定操作方法返回 void?

谢谢

In FubuMVC, when I want a controller action method to return a json result, I use the JsonEndpoint attribute on the method. However there is not a corresponding attribute for a void method that I can see.

For a particular action, I don't want to return anything, but if I have a void return result Fubu fails because it starts looking for a view to match an empty model to.

Is there a attribute or easy change to allow a particular action method to return void?

Thanks

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

入怼 2024-10-09 14:41:11

当我更新到框架的新版本时,单模型输入、零模型输出控制器操作立即可用。我唯一不确定如何做的是无控制器视图。

When I updated to a newer version of the framework, one-model-in, zero-model-out controller actions became instantly usable. The only thing I'm not sure how to do is controller-less views.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文