Exemple #1
0
        public async Task <IActionResult> GetById(int id)
        {
            try
            {
                var model = await _repairStatusService.GetAsync(id);

                return(Ok(model));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var repairStatus = await _repairStatusService.GetAsync(id);

                if (repairStatus != null)
                {
                    await _repairStatusService.DeleteAsync(repairStatus);
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
        }