예제 #1
0
        // POST: api/REST
        public HttpResponseMessage Post([FromBody] emp em)
        {
            context.emps.Add(em);
            context.SaveChanges();
            HttpResponseMessage message = new HttpResponseMessage();

            message.ReasonPhrase = "Created..";
            return(message);
        }
예제 #2
0
 public ActionResult AddNew(emp em)
 {
     context.emps.Add(em);
     context.SaveChanges();
     return(RedirectToAction("ShowAll"));
 }