public async Task <ActionResult <BusinessAgents> > PostBusinessAgents(BusinessAgents businessAgents) { _context.BusinessAgents.Add(businessAgents); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBusinessAgents", new { id = businessAgents.BusinessId }, businessAgents)); }
public async Task <IActionResult> PutBusinessAgents(long id, BusinessAgents businessAgents) { if (id != businessAgents.BusinessId) { return(BadRequest()); } _context.Entry(businessAgents).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessAgentsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }