public IActionResult Edit(int?id) { var personaVM = new PersonaViewModel(); try { if (id == null) { return(View("Error")); } var personaDB = _personaService.GetPersona(id); if (personaDB == null) { return(View("Error")); } personaVM = new PersonaViewModel { Persona = personaDB, Provincia = _provinciaService.GetAll() }; } catch (Exception) { return(View("Error")); } return(View(personaVM)); }
public IActionResult Index() { var provinciaVM = new List <ProvinciaViewModel>(); var provinciaDB = _provinciaService.GetAll(); foreach (var item in provinciaDB) { provinciaVM.Add(new ProvinciaViewModel { Provincia = item }); } return(View(provinciaVM)); }
public IList <ProvinciaDTO> Get() { return(Service.GetAll()); }