Esempio n. 1
0
        public void DeleteJob(Job job)
        {
            // Find job with matching ID
            var da      = new FreelanceDatabase();
            var success = da.DeleteJob(job.Id);

            if (success)
            {
                RefreshJobList();
            }
        }
Esempio n. 2
0
        public ActionResult DeleteJob(string id)
        {
            var jobById = _jobs.Where(x => x.Id == id);

            if (!jobById.Any())
            {
                return(NotFound());
            }

            bool success = _da.DeleteJob(id);

            if (!success)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  new { error = "Could not delete Job from database" }));
            }

            return(NoContent());
        }