Posted By

wedgardigitalwkscom on 03/02/11


Tagged


Versions (?)

BaseResult object with ToJson Method


 / Published in: C#
 

  1. using System;
  2. using System.Web.Script.Serialization;
  3.  
  4. namespace Test
  5. {
  6. [Serializable]
  7. public class BaseResult
  8. {
  9. public bool Success { get; set; }
  10. public string Message { get; set; }
  11.  
  12. public string ToJson()
  13. {
  14. var serializer = new JavaScriptSerializer();
  15. var _this = serializer.Serialize(this);
  16. return _this;
  17. }
  18. }
  19.  
  20.  
  21. }

Report this snippet  

You need to login to post a comment.