PrepAway - Latest Free Exam Questions & Answers

Which code segment should you insert at line 05?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You create the following service contract. (Line numbers are included for reference only.)

01 [ServiceContract]
02 public interface IMyService
03 {
04 [OperationContract]
06 List<string> GetData(int index);
07 }

You need to ensure that the GetData operation can be accessed by using the URI in the following manner:

GetData/1 for the index value 1
GetData/2 for the index value 2
..
GetData/n for the index value n

Which code segment should you insert at line 05?

PrepAway - Latest Free Exam Questions & Answers

A.
[WebGet(UriTemplate="GetData/{index}",
BodyStyle=WebMessageBodyStyle.Bare)]

B.
[WebGet(UriTemplate="GetData?index={index}",
BodyStyle=WebMessageBodyStyle.Bare)]

C.
[WebGet(UriTemplate="GetData/[index]",
BodyStyle=WebMessageBodyStyle.Bare)]

D.
[WebGet[UriTemplate="GetData?index={index}",
BodyStyle=WebMessageBodyStyle.Bare]]


Leave a Reply