相关疑难解决方法(0)

REST是否可以为空?

我打了砖墙.我的REST实现不接受Nullable值.

    [OperationContract]
    [WebInvoke(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/Transactions?AccNo={AccNo}&CostCentreNo={CostCentreNo}&TransactionType={TransactionType}&Outstanding={Outstanding}&CheckStartDate={CheckStartDate}&CheckEndDate={CheckEndDate}")]
    List<Transactions> GetTransactions(Int32 AccNo, Int32 CostCentreNo, Int32 TransactionType, Boolean Outstanding, DateTime? CheckStartDate, DateTime? CheckEndDate);
Run Code Online (Sandbox Code Playgroud)

而我原来的SOAP实现确实如此.那么有办法解决这个问题吗?或者我是否必须重新编写代码?

我仍然不明白为什么日期时间必须可以为空以便设置为null.

c# rest soap nullable

8
推荐指数
1
解决办法
3702
查看次数

标签 统计

c# ×1

nullable ×1

rest ×1

soap ×1