Change default date serialization in WCF

前端 未结 5 768
-上瘾入骨i
-上瘾入骨i 2020-12-03 07:39

Is there anyway to change the default JSON serialization/deserialization of DateTime in WCF?

Currently, DateTime are serialized into the /Date(1372252162657+0

5条回答
  •  悲哀的现实
    2020-12-03 08:16

    you can use this workaround, In your json object definition

    [IgnoreDataMember]
    public DateTime dateObject;
    
    public string dateCustomSerialize
    {
     get {
    //Custom get
    }
    set {
    //Custom set
    }
    }
    

    In assessor place your custom format serialisation

提交回复
热议问题