public async Task <ActionResult <leads> > Postleads(leads leads) { _context.leads.Add(leads); await _context.SaveChangesAsync(); return(CreatedAtAction("Getleads", new { id = leads.id }, leads)); }
public async Task <IActionResult> Putleads(long id, leads leads) { if (id != leads.id) { return(BadRequest()); } _context.Entry(leads).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!leadsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }