public string Test3(TestSerializerModel2 model) { return model.ToString(); }
public int Test3_AutoCheck(TestSerializerModel2 model) { //if( model.DtValue.HasValue && System.Web.HttpContext.Current.Request.ContentType.StartsWith("application/json") ) // model.DtValue = model.DtValue.Value.ToLocalTime(); string xml1 = model.ToString(); string xml2 = s_lastTestSerializerModel2.ToString(); return (xml1 == xml2 ? 1 : 0); }
private TestSerializerModel2 GetTestSerializerModel2() { Random rand = new Random(); TestSerializerModel2 model = new TestSerializerModel2 { StringVal = "Fish" }; if( rand.Next(1, 100) > 50 ) model.DtValue = DateTime.Now; if( rand.Next(1, 100) > 50 ) model.IntVal = rand.Next(10, 100); if( rand.Next(1, 100) > 50 ) model.Money = Math.Round(1000M * (decimal)rand.NextDouble(), 4); if( rand.Next(1, 100) > 50 ) model.Guid = Guid.NewGuid(); s_lastTestSerializerModel2 = model; return model; }