//For both Post (add) and Put (update) public void Post(BizEmployee employee) { if (employee != null) { BizEmployeeService.AddOrUpdate(employee); } }
public HttpResponseMessage Post([FromBody] BizEmployee emp) { BizEmployeeRep.AddOrUpdate(emp); var msg = Request.CreateResponse(HttpStatusCode.Created, emp); string url = Url.Link("DefaultApi", new { id = emp.EmployeeId }); msg.Headers.Location = new Uri(url); return(msg); }
// GET: ForEmployee public ActionResult Index() { var model = new BizEmployee(); return(View(model)); }