我有一個簡單的控制器,帶有一個無參數的Get和一個帶有ID的Get。 public class BooksController : ApiController
{
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
public st
我希望能夠通過不同的id類型標識資源。例如: GET http://example.com/customers/internalId=34去 public Customer GetByInternalId(int internalId){...}
和 GET http://example.com/customers/externalId= 'JOHNDOE' 去 public Customer
還有另一個這樣的問題,但我找不到答案來解釋爲什麼我在其他任何問題中都遇到此錯誤。 我有我的路線設置爲: public class ContentRoutes
{
public static void Map(RouteCollection _routes)
{
_routes.MapHttpRoute(
name: "GetThumbnail",
是否有可能採取行動? [HttpGet]
public List<Product> GET(int CategoryId, string option, params string[] properties)
{
List<Product> result = new List<Product>();
result = BusinessRules.getP