public async Task <IActionResult> PostMstNotificationStack([FromBody] MstNotificationStack mstNotificationStack) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstNotificationStack.Add(mstNotificationStack); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstNotificationStack", new { id = mstNotificationStack.NotificationId }, mstNotificationStack)); }
public async Task <IActionResult> PutMstNotificationStack([FromRoute] long id, [FromBody] MstNotificationStack mstNotificationStack) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstNotificationStack.NotificationId) { return(BadRequest()); } _context.Entry(mstNotificationStack).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstNotificationStackExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }