Ejemplo n.º 1
0
        public async Task <ActionResult> Trash(Guid id)
        {
            try
            {
                var statusCode = await _professorRepository.TrashProfessor(id);

                if (statusCode == HttpStatusCode.NotFound)
                {
                    return(HttpNotFound());
                }
            }
            catch (BadRequestException bre)
            {
                var errorString = GetErrorsFromAdycHttpExceptionToString(bre);

                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, errorString));
            }

            return(PartialView("pv_ProfessorRow", await _professorRepository.GetProfessorById(id)));
        }