// POST: api/REST public HttpResponseMessage Post([FromBody] emp em) { context.emps.Add(em); context.SaveChanges(); HttpResponseMessage message = new HttpResponseMessage(); message.ReasonPhrase = "Created.."; return(message); }
public ActionResult AddNew(emp em) { context.emps.Add(em); context.SaveChanges(); return(RedirectToAction("ShowAll")); }