public async Task <IActionResult> Putrate_types([FromRoute] int id, [FromBody] rate_types rate_types) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != rate_types.id) { return(BadRequest()); } _context.Entry(rate_types).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!rate_typesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Postrate_types([FromBody] rate_types rate_types) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.rate_types.Add(rate_types); await _context.SaveChangesAsync(); return(CreatedAtAction("Getrate_types", new { id = rate_types.id }, rate_types)); }