public IHttpActionResult Putregistration(string id, registration registration)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != registration.user_id)
            {
                return(BadRequest());
            }

            db.Entry(registration).State = EntityState.Modified;

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,User,PassWord")] Authentication authentication)
 {
     if (ModelState.IsValid)
     {
         db.Entry(authentication).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(authentication));
 }