Пример #1
0
        public IHttpActionResult PutRodrigoSantistevanFriend(int id, RodrigoSantistevanFriend rodrigoSantistevanFriend)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != rodrigoSantistevanFriend.FriendID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            RodrigoSantistevanFriend rodrigoSantistevanFriend = db.RodrigoSantistevanFriends.Find(id);

            db.RodrigoSantistevanFriends.Remove(rodrigoSantistevanFriend);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "FriendID,Nombre,Nickname,Birthdate,Friend,Status")] RodrigoSantistevanFriend rodrigoSantistevanFriend)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rodrigoSantistevanFriend).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(rodrigoSantistevanFriend));
 }
        public ActionResult Create([Bind(Include = "FriendID,Nombre,Nickname,Birthdate,Friend,Status")] RodrigoSantistevanFriend rodrigoSantistevanFriend)
        {
            if (ModelState.IsValid)
            {
                db.RodrigoSantistevanFriends.Add(rodrigoSantistevanFriend);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(rodrigoSantistevanFriend));
        }
Пример #5
0
        public IHttpActionResult GetRodrigoSantistevanFriend(int id)
        {
            RodrigoSantistevanFriend rodrigoSantistevanFriend = db.RodrigoSantistevanFriends.Find(id);

            if (rodrigoSantistevanFriend == null)
            {
                return(NotFound());
            }

            return(Ok(rodrigoSantistevanFriend));
        }
Пример #6
0
        public IHttpActionResult PostRodrigoSantistevanFriend(RodrigoSantistevanFriend rodrigoSantistevanFriend)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.RodrigoSantistevanFriends.Add(rodrigoSantistevanFriend);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = rodrigoSantistevanFriend.FriendID }, rodrigoSantistevanFriend));
        }
        // GET: RodrigoSantistevanFriends/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RodrigoSantistevanFriend rodrigoSantistevanFriend = db.RodrigoSantistevanFriends.Find(id);

            if (rodrigoSantistevanFriend == null)
            {
                return(HttpNotFound());
            }
            return(View(rodrigoSantistevanFriend));
        }
Пример #8
0
        public IHttpActionResult DeleteRodrigoSantistevanFriend(int id)
        {
            RodrigoSantistevanFriend rodrigoSantistevanFriend = db.RodrigoSantistevanFriends.Find(id);

            if (rodrigoSantistevanFriend == null)
            {
                return(NotFound());
            }

            db.RodrigoSantistevanFriends.Remove(rodrigoSantistevanFriend);
            db.SaveChanges();

            return(Ok(rodrigoSantistevanFriend));
        }