コード例 #1
0
        public async Task <IActionResult> Postapplication_configurations([FromBody] application_configurations application_configurations)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.application_configurations.Add(application_configurations);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getapplication_configurations", new { id = application_configurations.id }, application_configurations));
        }
コード例 #2
0
        public async Task <IActionResult> Putapplication_configurations([FromRoute] int id, [FromBody] application_configurations application_configurations)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(NoContent());
        }