public async Task <IActionResult> PutMThrmsbranch([FromRoute] long id, [FromBody] MThrmsbranch mThrmsbranch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mThrmsbranch.MThrmsbranchId) { return(BadRequest()); } _context.Entry(mThrmsbranch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MThrmsbranchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMThrmsbranch([FromBody] MThrmsbranch mThrmsbranch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MThrmsbranch.Add(mThrmsbranch); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMThrmsbranch", new { id = mThrmsbranch.MThrmsbranchId }, mThrmsbranch)); }