コード例 #1
0
        public JsonResult Get(int id)
        {
            try
            {
                var WFTrigger   = _repository.GetSingle(id);
                var WFTriggervm = WFTriggerViewModel.FromEntity(WFTrigger);

                if (WFTriggervm == null)
                {
                    return(Json(null));
                }
                return(Json(WFTriggervm));
            }
            catch (Exception ex)
            {
                _logger.LogError($"Failed to save employee", ex);
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(Json("Failed to save employee"));
            }
        }
コード例 #2
0
        public JsonResult Get()
        {
            try
            {
                var claims      = User.Claims.Select(x => new { x.Type, x.Value });
                var WFTriggers  = _repository.GetAll();
                var WFTriggervm = WFTriggers.Select(x => WFTriggerViewModel.FromEntity(x));

                if (WFTriggervm == null)
                {
                    return(Json(null));
                }
                return(Json(WFTriggervm));
            }
            catch (Exception ex)
            {
                _logger.LogError($"Failed to save employee", ex);
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(Json("Failed to save employee"));
            }
        }