Ejemplo n.º 1
0
        public async Task <IActionResult> PutInfo(int id, Info info)
        {
            if (id != info.infoId)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InfoExists(info.infoId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutSponsors(int id, Sponsors sponsors)
        {
            if (id != sponsors.sponsorId)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SponsorsExists(sponsors.sponsorId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> PutBloc(int id, Bloc bloc)
        {
            if (id != bloc.blocId)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BlocExists(bloc.blocId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> PutTeam(int id, Team team)
        {
            if (id != team.teamId)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PositionExists(team.teamId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> PutRol(int id, Rol rol)
        {
            if (id != rol.rolId)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RolExists(rol.rolId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }