예제 #1
0
        public IHttpActionResult PutEditUser(string id, Sp_Edit_User User)
        {//id
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != User.Id)
            {
                return(BadRequest());
            }
            db.edit_user(User.Id, User.Email, User.PhoneNumber, User.UserName, User.Country, User.State, User.Gender, User.Photo, User.Apout, User.AnotherAccount);
            //db.Entry(aspNetUser).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AspNetUserExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }