0
我在c#中开发了一个MVC web应用程序,并且使用Typescript前端。 我有一个方法进入控制器,接收带有数据模型的HttpPost请求,这个数据模型是用typelite自动生成到打字稿类中的。使用ajax发送打印稿日期
在我的请求数据模型中有一个日期时间字段,当我发送请求到后端时,数据时间字段被序列化为以下格式的字符串:“Sun + Dec + 25 + 2016 + 11:29:33 + GMT + 0100 +(ora + solare + Europa + occidentale)“ 我喜欢这个文件被serilize到UTC datetime字符串。
我的打字稿代码发送请求:
$.ajax({
method: callingMethod,
url: urlToCall,
data: *dataValue,
beforeSend: function() {
self.BeforeAsyncAction();
},
})
.done(callbackDone)
.fail(callbackFail)
.always(self.CompleteAsyncAction);
}
dataValue与此接口的类:我必须序列化到UTC日期时间
export class FileServiceModel extends Gedoc.WebApplication.ServiceModels.BaseServiceModel {
Allegato: Gedoc.WebApplication.ServiceModels.FileStreamServiceModel;
Attributi: Gedoc.WebApplication.ServiceModels.AttributoServiceModel[];
Descrizione: string;
DimensioneByte: number;
*DtIn: Date;
*DtRegistrazione: Date;
*DtUp: Date;
Id: number;
Tags: string;
Titolo: string;
}
- 领域。
如何最好的方式来序列自动这一领域
感谢认为