public async Task <ActionResult <JobEntity> > GetJob(int id) { var jobEntity = await logic.GetJob(id); if (jobEntity == null) { return(NotFound()); } return(jobEntity); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } JobEntity = await logic.GetJob((int)id); if (JobEntity == null) { return(NotFound()); } return(Page()); }
// GET: JobEntities/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var jobEntity = await jobslogic.GetJob((int)id); if (jobEntity == null) { return(NotFound()); } return(View(jobEntity)); }
public async Task Test_BL_UpdateJob() { //Arrange JobBusinessLogic businessLogic = new JobBusinessLogic(inMemory: true); JobEntity newjob = new JobEntity() { JobId = 1, Title = "Backend Senior Developer", CreatedAt = DateTime.Now, ExpiresAt = DateTime.Now.AddDays(30) }; //Act await businessLogic.CreateJob(newjob); var exists = businessLogic.JobExists(newjob.JobId); //Assert Assert.True(exists, "Job created"); //Act newjob.Title = ".NET Developer"; await businessLogic.UpdateJob(newjob); var updatedJob = await businessLogic.GetJob(newjob.JobId); //Assert Assert.True(updatedJob.Title == ".NET Developer", "Job updated"); }