コード例 #1
0
        public async Task <IActionResult> Complete(int id, bool status)
        {
            try
            {
                var result = await _repository.CompleteAsync(id, status);

                return(Ok(result));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Failed to complete task!"));
            }
        }
コード例 #2
0
        public async Task <IActionResult> Complete(int id, bool status)
        {
            var result = await _repository.CompleteAsync(id, status);

            return(RedirectToAction(nameof(Index)));
        }