Exemplo n.º 1
0
        public async Task <ActionResult <RuleApplication> > PostRuleApplication(RuleApplication ruleApplication)
        {
            _context.RuleApp.Add(ruleApplication);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetRuleApplication", new { id = ruleApplication.Id }, ruleApplication));
        }
Exemplo n.º 2
0
        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());
        }