【发布时间】:2016-03-31 23:44:24
【问题描述】:
我尝试将 2 个日期时间参数传递到我的 webget 中,但我不知道如何让它正常工作。我将在下面向您展示我的代码,我得到的错误也许有人现在知道这是如何工作的。
[WebGet]
public IQueryable<TestTable> GetCallersByDate(string beginDate, string eindDate)
{
testCDREntities context = this.CurrentDataSource;
DateTime startDt = DateTime.Parse(beginDate);
DateTime endDt = DateTime.Parse(eindDate);
var selectedOrders = from table in context.TestTables
where table.Created >= startDt && table.Created <= endDt
select table;
return selectedOrders;
}
网址:
http://localhost:50088/WebService.svc/GetCallersByDate?beginDate=2016/03/23T20:22:30:14&eindDate=2016/03/2T20:13:11:03
我希望有人可以帮助我吗?
【问题讨论】:
-
至少那些斜线会有问题,URL 编码你的数据。
标签: c# mysql wcf datetime webget