UriTemplate WCF [英] UriTemplate WCF

查看:34
本文介绍了UriTemplate WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以在同一定义中包含多个 UriTemplate.

Is there a simple way to have multiple UriTemplates in the same definition.

 [WebGet(UriTemplate = "{id}")]

例如,我希望/API/{id} 和/API/{id}/调用相同的东西.我不希望它到底有没有/.

For example I want /API/{id} and /API/{id}/ to call the same thing. I don't want it to matter if there is / at the end or not.

推荐答案

我发现最简单的方法是重载函数 如此处所述.

The easiest way I found to do this is to overload the function as explained here.

这篇关于UriTemplate WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆