Return to Snippet

Revision: 42290
at March 2, 2011 22:48 by wedgardigitalwkscom


Initial Code
using System;
using System.Web.Script.Serialization;

namespace Test
{
    [Serializable]
    public class BaseResult
    {
        public bool Success { get; set; }
        public string Message { get; set; }

        public string ToJson() 
        {
            var serializer = new JavaScriptSerializer();
            var _this = serializer.Serialize(this);
            return _this;
        }
    }

    
}

Initial URL

                                

Initial Description

                                

Initial Title
BaseResult object with ToJson Method

Initial Tags

                                

Initial Language
C#