コード例 #1
0
        public async Task <IActionResult> UpdateRun([FromBody] Run run)
        {
            var response = new SingleModelResponse <Run>()
                           as ISingleModelResponse <Run>;

            try
            {
                if (run == null)
                {
                    throw new Exception("Run is missing");
                }
                response.Model = await Task.Run(() =>
                {
                    Run runn = _context.UpdateRun(run);
                    return(runn);
                });
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }
            return(response.ToHttpResponse());
        }