Exemplo n.º 1
0
 public JsonResult()
     : base()
 {
     //ResultType = "";
     Result = DefaultValueHelper.GetDefault <T>();
     Error  = "";
 }
Exemplo n.º 2
0
        public static JsonResult <T> Execute <T>(String ResultType, Func <T> Func)
        {
            JsonResult <T> lResult = new JsonResult <T>()
            {
                //ResultType = ResultType,
                Result = DefaultValueHelper.GetDefault <T>()
            };

            try
            {
                if (Func != null)
                {
                    lResult.Result = Func();
                }
            }
            catch (Exception ex)
            {
                lResult.Error = ex.Message;
                //lResult.IsLoginError = ex is SrvLoginException;
            }
            return(lResult);
        }