Beispiel #1
0
        public async Task <IActionResult> ChangeTest([FromBody] ChangeTest test)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                var userInfo = await _testService.ChangeTest(test);

                if (userInfo.Error != null)
                {
                    return(StatusCode(userInfo.Error.ErrorCode, userInfo.Error.ErrorDescriprion));
                }

                return(Ok(userInfo.Data));
            }
            catch (Exception e)
            {
                return(StatusCode(500, new Error(e.Message)));
            }
        }