Ejemplo n.º 1
0
        public async Task <bool> Delete(JobType item)
        {
            _repo.Delete(item);
            await _unitOfWork.Save();

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Delete Job Type by id
        /// </summary>
        public void DeleteJobType(long jobTypeId)
        {
            JobType dbversion = jobTypeRepository.Find((int)jobTypeId);

            ValidateBeforeDeletion(jobTypeId);
            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Job Type with Id {0} not found!", jobTypeId));
            }
            jobTypeRepository.Delete(dbversion);
            jobTypeRepository.SaveChanges();
        }
        public async Task <ActionResult> Delete(int id)
        {
            await _repository.Delete(id);

            return(NoContent());
        }