【发布时间】:2015-06-09 20:21:44
【问题描述】:
早安(这里)
我正在使用 NancyFx,当我尝试使用 TimeSpan 属性绑定一个类时遇到问题,我也在使用 AngularJs
我使用的 json 是:
{ "描述": "foo",
“时间表”:{ “天”:0, “小时”:23, “分钟”:36, “秒”:10, “毫秒”:0 } };
我的 C# 类
public class Scheduler
{
public int IDHorario{ get; set; }
public string Descripcion { get; set; }
public Nullable<TimeSpan> scheduleTime{ get; set; }
}
我的南希模块
Post["/Add"] = parameters =>
{
var sch= this.Bind<Scheduler>();
HorarioDB.CreateHorario(sch);
return new Response().WithStatusCode(HttpStatusCode.OK);
};
但我收到 scheduleTime null,我不知道为什么? :'(
有什么想法吗??
非常感谢
【问题讨论】:
标签: c# angularjs model-binding nancy