public async Task <IActionResult> PutRelRouteUser([FromRoute] int id, [FromBody] RelRouteUser relRouteUser)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != relRouteUser.IdRelation)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutRoutes([FromBody] Routes routes)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (routes == null || routes.Id == 0)
            {
                return(BadRequest());
            }

            Boolean exist = _context.Routes.Where(o => o.Id != routes.Id && o.Route.ToLower() == routes.Route.ToLower()).Any();

            if (exist)
            {
                return(BadRequest("La ruta ya se encuentra en uso!"));
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoutesExists(routes.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }