那我要问什么?这是为了看看有没有更好的方法让url与
数据合同
而不是必须创建
public T GetObject<T>(string uri)
把它和
GetObject<ExampleDataContract>("http://blah/")
public T GetObject<T>()
{
string uri = "";
string type = typeof(T).ToString();
switch (type)
{
case "Namespace.ExampleDataContract":
uri = "http://www.example.com/blah.json";
break;
}
return JsonHelper.Deserialize<T>(this.GetJson(uri));
}