2011-01-09 100 views
0

圖形API的Facebook,如果你不提供有效令牌返回該錯誤。返回JSON異常

在WCF與.NET 4我怎麼能返回相同的Json「異常」用這種方法:

[WebGet(UriTemplate = "{id}")] 
public SampleItem Get(string id) 
{ 
    if (id.Length != 4) 
     "how to return here the error since this method return a sample item class"???? 
    else 
     return rep.GetSampleByID(id); 
} 
+0

你問如何構建一個複製Facebook API響應的JSON字符串? – diagonalbatman 2011-01-09 13:48:39

回答