public async Task <IActionResult> PutMstMagazineAdType([FromRoute] int id, [FromBody] MstMagazineAdType mstMagazineAdType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstMagazineAdType.MagazineAdTypeId) { return(BadRequest()); } _context.Entry(mstMagazineAdType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstMagazineAdTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstMagazineAdType([FromBody] MstMagazineAdType mstMagazineAdType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstMagazineAdType.Add(mstMagazineAdType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstMagazineAdType", new { id = mstMagazineAdType.MagazineAdTypeId }, mstMagazineAdType)); }