コード例 #1
0
        public JsonResult GetTask(int id)
        {
            var jsonSuccessResult = new JsonSuccessResult();

            try
            {
                var data = UserTasks.GetByID(id);
                jsonSuccessResult.Data    = Mapper.Map <JsonUserTask>(data);
                jsonSuccessResult.Success = true;
            }
            catch (Exception ex)
            {
                jsonSuccessResult.Errors  = new string[] { ex.Message };
                jsonSuccessResult.Success = false;
            }

            return(new JsonResult()
            {
                Data = jsonSuccessResult
            });
        }