public async Task <IActionResult> PutMstDomain([FromRoute] int id, [FromBody] MstDomain mstDomain) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstDomain.DomainId) { return(BadRequest()); } _context.Entry(mstDomain).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstDomainExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstDomain([FromBody] MstDomain mstDomain) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstDomain.Add(mstDomain); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstDomain", new { id = mstDomain.DomainId }, mstDomain)); }