public RentalRequests GetByID(int id) { try { RentalRequests ResponseEntity; using (var rentalRequestRepository = new RentalRequestRepository()) { ResponseEntity = rentalRequestRepository.GetByID(id); if (ResponseEntity == null) { throw new NullReferenceException("Entity doesnt exists!"); } return(ResponseEntity); } } catch (Exception ex) { LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true); throw new Exception("CarRental.BusinessLogic.Concretes:GenericBusinessLogic::GetByID::Error occured.", ex); } }