public async Task <IActionResult> PostMThrmsmanPowerBudget([FromBody] MThrmsmanPowerBudget mThrmsmanPowerBudget) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MThrmsmanPowerBudget.Add(mThrmsmanPowerBudget); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMThrmsmanPowerBudget", new { id = mThrmsmanPowerBudget.MThrmsmanPowerBudgetId }, mThrmsmanPowerBudget)); }
public async Task <IActionResult> PutMThrmsmanPowerBudget([FromRoute] long id, [FromBody] MThrmsmanPowerBudget mThrmsmanPowerBudget) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mThrmsmanPowerBudget.MThrmsmanPowerBudgetId) { return(BadRequest()); } _context.Entry(mThrmsmanPowerBudget).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MThrmsmanPowerBudgetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }