Example #1
0
        public async Task <IActionResult> PutCarType(int id, CarType carType)
        {
            if (id != carType.CarTypeID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutOT(int id, OT oT)
        {
            if (id != oT.OTID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #3
0
        public async Task <IActionResult> PutFoodSet(int id, FoodSet foodSet)
        {
            if (id != foodSet.FoodSetID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }