Ejemplo n.º 1
0
        public virtual ScriptResult <T> ExecuteRequest <T>(Func <T> executeMethod)
        {
            ScriptResult <T> scriptResponse = new ScriptResult <T>();

            try
            {
                scriptResponse.Data   = executeMethod();
                scriptResponse.Status = true;
            }
            catch (Exception ex)
            {
                scriptResponse.ErrorDetails = ex.Message;
            }
            return(scriptResponse);
        }
Ejemplo n.º 2
0
        public virtual ScriptResult ExecuteRequest(Action executeMethod)
        {
            ScriptResult scriptResponse = new ScriptResult();

            try
            {
                executeMethod();
                scriptResponse.Status = true;
            }
            catch (Exception ex)
            {
                scriptResponse.ErrorDetails = ex.Message;
            }
            return(scriptResponse);
        }