Beispiel #1
0
        public IActionResult _Detail(int?id)
        {
            var paisVM = new PaisViewModel();

            try
            {
                if (id == null)
                {
                    return(View("Error"));
                }

                var provinciaDB = _provinciaService.GetProvinciaByPais(id);

                if (provinciaDB == null)
                {
                    return(View("Error"));
                }

                paisVM = new PaisViewModel
                {
                    Provincia = provinciaDB
                };
            }
            catch (Exception)
            {
                return(View("Error"));
            }

            return(View(paisVM));
        }