public List <UserDto> GetAllUsers() { var users = _userRepository.GetAll().ToList(); if (!users.Any()) { return(new List <UserDto>()); } var lstUserDto = QsMapper.CreateMapList <User, UserDto>(users); return(lstUserDto); }
public List <FeedbackDto> GetAllFeedback() { var feedbacks = _feedbackRepository.GetAllWithOrder(filter => filter.CreateTime).ToList(); if (!feedbacks.Any()) { return(new List <FeedbackDto>()); } var lstFeedbackDto = QsMapper.CreateMapList <Feedback, FeedbackDto>(feedbacks); return(lstFeedbackDto); }
public List <FbDocumentDto> GetAllDocument() { var documents = _respository.GetAllWithOrder(filter => filter.UploadDate).ToList(); if (!documents.Any()) { return(new List <FbDocumentDto>()); } var lstDocumentDto = QsMapper.CreateMapList <FbDocument, FbDocumentDto>(documents); return(lstDocumentDto); }
public List <UserDto> FindUsers(int pageIndex, int pageCount) { if (pageIndex < 0 || pageCount <= 0) { throw new ArgumentNullException(Message.warning_InvalidArgumentForFindUsers); } var users = _userRepository.GetPaged <string>(pageIndex, pageCount, o => o.StuNumber, false).ToList(); if (!users.Any()) { return(new List <UserDto>()); } var lstUserDto = QsMapper.CreateMapList <User, UserDto>(users); //var lstUserDto = QsMapper.CreateMap<List<User>, List<UserDto>>(users); return(lstUserDto); }