Esempio n. 1
0
        public async Task <IActionResult> PutDbfile([FromRoute] int id, [FromBody] Dbfile dbfile)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutSqlServer([FromRoute] string id, [FromBody] SqlServer sqlServer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(NoContent());
        }