/// <summary> /// Fetching all users according to status /// </summary> /// <param name="status"></param> /// <returns> list of all users according to status</returns> public List <UserRequestDto> GetAllByStatus(Status status) { List <User> users = userRepository.GetAllUsers(); UserRequestStatusRepository userRequestStatusRepository = new UserRequestStatusRepository(); List <UserRequestStatus> statuses = userRequestStatusRepository.GetAllRequests(); if (users == null) { return(null); } else { List <UserRequestDto> userRequestDto = (from m in users join s in statuses on m.UserId equals s.UserId where s.RequestStatus == status select new UserRequestDto { UserId = m.UserId, AadharNumber = m.AadharNumber, IsApprover = m.IsApprover, Status = s.RequestStatus.ToString(), FullName = m.FirstName + m.LastName, Email = m.EmailId, Image = m.ProfileImage, Password = m.Password }).ToList(); return(userRequestDto); } }
public UserRequestStatusService() { userRequestStatusRepository = new UserRequestStatusRepository(); mapper = new CustomAutoMapper(); }