Ejemplo n.º 1
0
 // GET: api/Pptp
 public server GetServer()
 {
     using (PPTPEntities db = new PPTPEntities())
     {
         var res = db.servers.ToList().FirstOrDefault();
         return(res);
     }
 }
Ejemplo n.º 2
0
        //GET: api/Pptp/5
        //public server GetServer([FromBody] server srv)
        //{
        //    using (PPTPEntities db = new PPTPEntities())
        //    {
        //        var res = db.servers.ToList().Find(p => p.Server1 == srv.Server1);
        //        return res;
        //    }
        //}

        // POST: api/Pptp
        public string PostServer([FromBody] server srv)
        {
            using (PPTPEntities db = new PPTPEntities())
            {
                db.servers.Add(srv);
                db.SaveChanges();
                return("Server Saved Successfully");
            }
        }