示例#1
0
        public ActionResult <ResultModel <int> > Update([FromRoute] string id, [FromForm] List <Strategy> strategies = null)
        {
            var rs = new ResultModel <int>();

            if (strategies == null || strategies.Count == 0)
            {
                strategies = new();
                strategies.Add(new Strategy());
            }

            try
            {
                rs.Data = _service.UpdateStrategies(id, strategies);
            }
            catch (Exception ex)
            {
                rs.Code    = ex.HResult;
                rs.Message = ex.ToString();
            }

            return(rs);
        }