我正在使用 ServiceStack 构建一个相当简单的服务,但是在我的几个服务中出现了这个非描述性错误(在尝试查看 uri 时在浏览器中)。错误代码:请求绑定异常。消息:无法绑定请求。
这是我拥有的 DTO:
[Route("/jtip/cases/{Count}, GET")]
public class AgencyCaseSummary : IReturn<AgencyCaseSummaryResponse>
{
public int Count { get; set; }
}
public class CaseSummary
{
public int Id { get; set; }
public string AgencyCaseNumber { get; set; }
public string AgencyRepName { get; set; }
public string Service { get; set; }
public string Milestone { get; set; }
public string Status { get; set; }
}
public class AgencyCaseSummaryResponse
{
public List<CaseSummary> CaseSummary { get; set; }
public int ActiveCaseCount { get; set; }
public int OpenRequestCount { get; set; }
}
这是我的服务:
public class AgencyCaseSummaryService : ServiceStack.ServiceInterface.Service
{
// Injection handled by Funq
public IRequestService RequestService { get; set; }
public ILog Log { get; set; }
/// <summary>
/// Gets the case summary for the most recent cases
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public AgencyCaseSummaryResponse Get(AgencyCaseSummary request)
{
AgencyCaseSummaryResponse summary = new AgencyCaseSummaryResponse();
Log.Info("Created new agency case summary call");
try
{
if (request.Count > 0)
{
var caseSummary = RequestService.GetRecentCases(request.Count);
summary.ActiveCaseCount = caseSummary.ActiveCaseCount;
summary.OpenRequestCount = caseSummary.OpenRequestCount;
if (caseSummary.Cases.Count > 0)
summary.CaseSummary = DTOMapper.Map(caseSummary.Cases);
}
}
catch (Exception ex)
{
Log.Error("Api.AgencyCaseService", ex);
}
return summary;
}
}
我在这里错过了什么吗?错误是什么意思?