public async Task <IActionResult> Upsert(JobVM obj) { if (ModelState.IsValid) { if (obj.Job.Id == 0) { await _jobsRepo.CreateAsync(SD.JobsAPIPath, obj.Job); } else { await _jobsRepo.UpdateAsync(SD.JobsAPIPath + obj.Job.Id, obj.Job); } return(RedirectToAction(nameof(Index))); } else { return(View(obj)); } }