public JobApplicationState CreateJobApplicationState(JobApplicationState jobApplicationState)
        {
            db.JobApplicationStates.Add(jobApplicationState);
            db.SaveChanges();

            return jobApplicationState;
        }
        public IHttpActionResult PutJobApplicationState(int id, JobApplicationState jobApplicationState)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != jobApplicationState.JobApplicationStateID)
            {
                return BadRequest();
            }

            try
            {
                db.UpdateJobApplicationState(id, jobApplicationState);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JobApplicationStateExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public JobApplicationState Create(JobApplicationState oJobApplicationState)
        {
            if (oJobApplicationState != null)
            {
                return oJobApplicationStateRepos.CreateJobApplicationState(oJobApplicationState);
            }

            return null;
        }
        public IHttpActionResult PostJobApplicationState(JobApplicationState jobApplicationState)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.CreateJobApplicationState(jobApplicationState);

            return CreatedAtRoute("DefaultApi", new { id = jobApplicationState.JobApplicationStateID }, jobApplicationState);
        }
        public void UpdateJobApplicationState(int id, JobApplicationState jobApplicationState)
        {
            db.Entry(jobApplicationState).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }
        }
        /// <summary>
        /// Converts this instance of <see cref="JobApplicationStateDTO"/> to an instance of <see cref="JobApplicationState"/>.
        /// </summary>
        /// <param name="dto"><see cref="JobApplicationStateDTO"/> to convert.</param>
        public static JobApplicationState ToEntity(this JobApplicationStateDTO dto)
        {
            if (dto == null) return null;

            var entity = new JobApplicationState();

            entity.JobApplicationStateID = dto.JobApplicationStateID;
            entity.JobApplicationID = dto.JobApplicationID;
            entity.JobApplicationStatusID = dto.JobApplicationStatusID;
            entity.insdt = dto.insdt;
            entity.insuser = dto.insuser;

            dto.OnEntity(entity);

            return entity;
        }
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="JobApplicationState"/> converted from <see cref="JobApplicationStateDTO"/>.</param>
 static partial void OnEntity(this JobApplicationStateDTO dto, JobApplicationState entity);