Ejemplo n.º 1
0
        public async Task <ActionResult> Delete(int id, IFormCollection collection)
        {
            try
            {
                await coursesRepository.DeleteAsync(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
        public async Task<IActionResult> Delete(Guid studentID)
        {
            try
            {
                var res = await _studentRepository.DeleteAsync(studentID);

                return Ok(res);
            }
            catch (Exception ex)
            {
                return BadRequest(ex);
            }
        }