public static List <Cliente> Listar() { try { return(ClienteRep.Listar()); } catch (Exception) { throw; } }
// GET: /<controller>/ public IActionResult Index() { List <Cliente> lstCliente = new List <Cliente>(); try { ClienteRep objClienteRep = new ClienteRep(); lstCliente = objClienteRep.Listar().ToList(); } catch (System.Exception ex) { TempData["Erro"] = ex.Message; } return(View(lstCliente)); }
public static List <Cliente> Listar() { return(ClienteRep.Listar()); }