コード例 #1
0
        public async Task <IActionResult> PutCaliber(int id, Caliber caliber)
        {
            if (id != caliber.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PutPowderShape(int id, PowderShape powderShape)
        {
            if (id != powderShape.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #3
0
        public async Task <IActionResult> PutBullet(int id, Bullet bullet)
        {
            if (id != bullet.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #4
0
        public async Task <IActionResult> PutMaterial(int id, Material material)
        {
            if (id != material.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #5
0
        public async Task <IActionResult> PutShootingSession(int id, ShootingSession shootingSession)
        {
            if (id != shootingSession.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }