GlobalConfiguration.Configuration.Formatters.Remove(new XmlMediaTypeFormatter()); // 解決json序列化時的循環引用問題 GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; // 對 JSON 數據使用混合大小寫。駝峯式,可是是javascript 首字母小寫形式. GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); //對日期格式進行統一處理 GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.Converters.Add( new IsoDateTimeConverter() { DateTimeFormat = "yyyy-MM-dd HH:mm:ss.fff" });