public DemandDto GetDemandDto(int Id) { var demand = demandRepository.GetSingle(p => p.Id == Id && p.RecordStatus == Helpdesk.Model.Enums.RecordStatus.A); if (demand == null) { throw new KeyNotFoundException(); } return(mapper.Map <DemandDto>(demand)); }