예제 #1
0
        public async Task <IActionResult> PutNeuralSettingsSet([FromRoute] int id, [FromBody] NeuralSettingsSet neuralSettingsSet)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != neuralSettingsSet.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <IActionResult> PostNeuralSettingsSet([FromBody] NeuralSettingsSet neuralSettingsSet)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.NeuralSettingsSet.Add(neuralSettingsSet);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetNeuralSettingsSet", new { id = neuralSettingsSet.Id }, neuralSettingsSet));
        }