public async Task <ActionResult <RuleApplication> > PostRuleApplication(RuleApplication ruleApplication) { _context.RuleApp.Add(ruleApplication); await _context.SaveChangesAsync(); return(CreatedAtAction("GetRuleApplication", new { id = ruleApplication.Id }, ruleApplication)); }
public async Task <IActionResult> PutRuleApplication(string id, RuleApplication ruleApplication) { if (id != ruleApplication.Id) { return(BadRequest()); } _context.Entry(ruleApplication).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RuleApplicationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }