Example #1
0
        public async Task <IActionResult> PutBFormulaStep([FromRoute] int id, [FromBody] BFormulaStep bFormulaStep)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != bFormulaStep.StepId)
            {
                return(BadRequest());
            }

            _context.Entry(bFormulaStep).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BFormulaStepExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PostBFormulaStep([FromBody] BFormulaStep bFormulaStep)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.BFormulaStep.Add(bFormulaStep);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBFormulaStep", new { id = bFormulaStep.StepId }, bFormulaStep));
        }