Exemple #1
0
 public IHttpActionResult PostJob(JobOpening job)
 {
     if (ModelState.IsValid)                   // checking the modelstate to make sure the data added in the table is correct
     {
         bool isSuccess = jobs.AddNewJob(job); // AddNewJob of Jobs class will add new job in Job Opening table in DB
         return(isSuccess ? (IHttpActionResult)Ok() : BadRequest("Internal Server Error"));
     }
     return(BadRequest("Check the model state"));
 }