Bagikan melalui


WebGetAttribute.ResponseFormat Properti

Definisi

Mendapatkan atau mengatur ResponseFormat properti.

public:
 property System::ServiceModel::Web::WebMessageFormat ResponseFormat { System::ServiceModel::Web::WebMessageFormat get(); void set(System::ServiceModel::Web::WebMessageFormat value); };
public System.ServiceModel.Web.WebMessageFormat ResponseFormat { get; set; }
member this.ResponseFormat : System.ServiceModel.Web.WebMessageFormat with get, set
Public Property ResponseFormat As WebMessageFormat

Nilai Properti

Salah WebMessageFormat satu nilai enumerasi.

Contoh

Contoh berikut menunjukkan cara mengatur ResponseFormat properti.

[OperationContract]
[WebGet(ResponseFormat= WebMessageFormat.Json)]
long Mod(long x, long y);
<OperationContract()> _
<WebGet(ResponseFormat:=WebMessageFormat.Json)> _
Function Modulo(ByVal x As Long, ByVal y As Long) As Long

Keterangan

Properti ini menentukan format respons yang dikirim dari operasi layanan. Dua nilai yang mungkin adalah Xml dan Json.

Berlaku untuk