RestSharp执行工作非常慢

时间:2013-11-19 15:43:12

标签: c# wcf rest restsharp webhttpbinding

从数据库调用9000自定义对象上的Execute需要大约10秒才是正常情况吗?

var client = new RestClient("http://localhost:8732/carservice");
var request = new RestRequest(Method.GET);
request.Resource = "GetCarList";
var response = client.Execute<List<Car>>(request);

和在ms sql上工作的方法:

public List<Car> GetCarList()
{
   using (var context = new CarEntities(DbAccess.connectionString))
   {
       return context.Car.Include("Owner").Include("Place").Include("Model").ToList<Car>();
   }
}

和服务:

[OperationContract]
[WebGet(ResponseFormat=WebMessageFormat.Xml)]
List<Car> GetCarList();

0 个答案:

没有答案