从数据库调用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();