Esempio n. 1
0
        public async Task <IActionResult> PutPost(int id, Post post)
        {
            if (id != post.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutUserWorkExperience(int id, UserWorkExperience userWorkExperience)
        {
            if (id != userWorkExperience.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> PutFollow(int id, Follow follow)
        {
            if (id != follow.UserId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 4
0
        public async Task <IActionResult> PutOnlineUser(int id, OnlineUser onlineUser)
        {
            if (id != onlineUser.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }