多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.) 01 [ServiceContract( )] 02 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 03 public Class LibraryService 04 { 05 public Book GetBookByTitle(string title) 06 { 07 ... 08 } 09 10 [WebGet(UriTemplate = "Book/{id}")] 11 public Book GetBookById(string id) 12 { 13 ... 14 } 15 }Library patrons want the ability to search the catalog by title.You need to ensure that the GetBookByTitle method is exposed as a service method.Which code segment should you insert at line 04?()

  • A、[WebGet(UriTemplate = "Book/{title}")]
  • B、[WebGet(UriTemplate = "BookByTitle/{title}")]
  • C、[WebGet(UriTemplate = "Book/{titleToSearch}")]
  • D、[WebGet(UriTemplate = "{titleToSearch}")]
正确答案:B
答案解析:
进入题库查看解析

微信扫一扫手机做题