//[ValidateAntiForgeryToken] public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,Title,Description,SkillSummary,TestimonyUrl,Salary,StartDate,EndDate,Current")] UserJobHistory userJobHistory) { if (id != userJobHistory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userJobHistory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserJobHistoryExists(userJobHistory.Id)) { return(NotFound()); } else { throw; } } return(Ok()); } return(new JsonResult(userJobHistory)); }
//[ValidateAntiForgeryToken] public async Task <IActionResult> Create([Bind("Id,UserId,Title,Description,SkillSummary,TestimonyUrl,Salary,StartDate,EndDate,Current")] UserJobHistory userJobHistory) { if (ModelState.IsValid) { _context.Add(userJobHistory); await _context.SaveChangesAsync(); return(Ok()); } return(new JsonResult(userJobHistory)); }