public async Task <IActionResult> PostBusinessandserviceq([FromBody] Businessandserviceq businessandserviceq) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Businessandserviceq.Add(businessandserviceq); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (BusinessandserviceqExists(businessandserviceq.Gqid)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetBusinessandserviceq", new { id = businessandserviceq.Gqid }, businessandserviceq)); }
public async Task <IActionResult> PutBusinessandserviceq([FromRoute] int id, [FromBody] Businessandserviceq businessandserviceq) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != businessandserviceq.Gqid) { return(BadRequest()); } _context.Entry(businessandserviceq).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessandserviceqExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }