public async Task <IActionResult> Edit(Guid id, [Bind("Id")] TotalLeads totalLeads) { if (id != totalLeads.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(totalLeads); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TotalLeadsExists(totalLeads.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(totalLeads)); }
public IActionResult Index(TotalLeads totalLeads) { //return View(await _context.TotalLeads.ToListAsync()); totalLeadsService.ObtenerLista(); return(View(totalLeads)); }
public async Task <IActionResult> Create([Bind("Id")] TotalLeads totalLeads) { if (ModelState.IsValid) { totalLeads.Id = Guid.NewGuid(); _context.Add(totalLeads); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(totalLeads)); }