public BsJsonResult(object obj = null, BsResponseStatus statusInfo = BsResponseStatus.Success, string errorMessage = null, string json = null, int? jsonMaxLength = null) { if (json == null) { var serializer = new JavaScriptSerializer(); if (jsonMaxLength.HasValue) { serializer.MaxJsonLength = jsonMaxLength.Value; } object result = new { Data = obj, Status = statusInfo, Message = errorMessage, Release = BForms.Utilities.BsConfigurationManager.GetRelease() }; Json = serializer.Serialize(result); } else { Json = json; } }
public BsJsonResult(object obj = null, BsResponseStatus statusInfo = BsResponseStatus.Success, string errorMessage = null, string json = null, int?jsonMaxLength = null) { if (json == null) { object result = new { Data = obj, Status = statusInfo, Message = errorMessage, Release = BForms.Utilities.BsConfigurationManager.GetRelease() }; Json = JsonConvert.SerializeObject(result); } else { Json = json; } }
public BsJsonResult(object obj = null, BsResponseStatus statusInfo = BsResponseStatus.Success, string errorMessage = null, string json = null, int? jsonMaxLength = null) { if (json == null) { object result = new { Data = obj, Status = statusInfo, Message = errorMessage, Release = BForms.Utilities.BsConfigurationManager.GetRelease() }; Json = JsonConvert.SerializeObject(result); } else { Json = json; } }