Ejemplo n.º 1
0
        public async Task <IActionResult> PutFamily(int id, Family family)
        {
            if (id != family.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutProcessor(int id, Processor processor)
        {
            if (id != processor.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> PutKingdom(int id, Kingdom kingdom)
        {
            if (id != kingdom.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> PutLaptopFeatures(int id, LaptopFeatures laptopFeatures)
        {
            if (id != laptopFeatures.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }