1
컨트롤러 끝점의 경로에서 선택적 매개 변수를 정의하는 올바른 구문은 무엇입니까? 경로의 선택적 매개 변수를 정의하는 Web.Api
[Route("customers/{customerId}/boats/{boatId}/bookings{contractId?}&{startDate?}&{endDate?}&{outOnly?}", Name = "GetBookingsByBoat")]
[ResponseType(typeof (IEnumerable<BookingSummaryDTO>))]
public IHttpActionResult Get(int customerId, int boatId, int? contractId, DateTime? startDate, DateTime? endDate, bool outOnly = false)
{
위의 컴파일
하지만customers/40/boats/24/bookings
를 사용하여 엔드 포인트를 시도하고 호출 할 때 내가 얻을 :
:{"message":"The requested resource does not support http method 'GET'."}
많은 감사