示例#1
0
        public async Task <IActionResult> PutRouteType(int id, RouteType routeType)
        {
            if (id != routeType.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutDelayReason(int id, DelayReason delayReason)
        {
            if (id != delayReason.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#3
0
        public async Task <IActionResult> PutFareClass(int id, FareClass fareClass)
        {
            if (id != fareClass.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#4
0
        public async Task <IActionResult> PutCommuteLeg(int id, CommuteLeg commuteLeg)
        {
            if (id != commuteLeg.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }