Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用实体框架检索WebApi 2_C#_Sql Server_Linq_Asp.net Web Api - Fatal编程技术网

C# 使用实体框架检索WebApi 2

C# 使用实体框架检索WebApi 2,c#,sql-server,linq,asp.net-web-api,C#,Sql Server,Linq,Asp.net Web Api,我想要实现的是从数据库中检索所有数据,现在我知道我需要替换 单缺省 我能知道下面的方法叫什么吗?我不认为是林克 [Route("api/{AuthCode}/LoadWorkers")] public Task<HttpResponseMessage> GET(String Authcode) { DateTime futureDate = new DateTime(); futureDate = DateTime.Now.AddDays(90); worke

我想要实现的是从数据库中检索所有数据,现在我知道我需要替换

单缺省

我能知道下面的方法叫什么吗?我不认为是林克

[Route("api/{AuthCode}/LoadWorkers")]
public Task<HttpResponseMessage> GET(String Authcode)
{
    DateTime futureDate = new DateTime();
    futureDate = DateTime.Now.AddDays(90);
    worker result = new worker();
    result = KKDB.workers.SingleOrDefault(p => p.WWPED <= futureDate);
    return Task.FromResult(Request.CreateResponse<worker>(HttpStatusCode.OK, result));
}
[路由(“api/{AuthCode}/LoadWorkers”)]
公共任务获取(字符串Authcode)
{
DateTime futureDate=新日期时间();
futureDate=DateTime.Now.AddDays(90);
工人结果=新工人();
结果=KKDB.workers.SingleOrDefault(p=>p.WWPED x.WWPED尝试使用
。其中(x=>x.WWPED
[Route("api/{AuthCode}/LoadWorkers")]
public Task<HttpResponseMessage> GET(String Authcode)
{
  DateTime futureDate = new DateTime();
  futureDate = DateTime.Now.AddDays(90);
  var result = KKDB.workers.Where(x => x.WWPED <= futureDate);
  return Task.FromResult(Request.CreateResponse<IQueryable<worker>>HttpStatusCode.OK,result));
}