Exemplo n.º 1
0
        /// <summary>
        /// Action de suppression
        /// </summary>
        /// <param name="id">Identifiant de l'école à supprimer</param>
        /// <returns></returns>
        public ActionResult Delete(int id)
        {
            var school = schoolService.GetById(id);

            if (school == null)
            {
                ViewBag.Error = $"Aucune école ne correspond à l'id {id}";
            }

            if (school != null)
            {
                schoolService.Delete(id);
            }

            return(View("Index", schoolService.GetAll()));
        }