public Page <UserActivityResponseDto> FindAll(UserActivitySearchDto request) { var query = _db.UserActivites.AsQueryable(); if (request.UserId != null) { query = query.Where(activity => activity.UserId == request.UserId); } if (request.ActionType != null) { query = query.Where(activity => activity.ActionType.ToLower().Contains(request.ActionType.ToLower())); } if (request.CreatedAt != null) { query = query.Where(activity => activity.CreatedAt.CompareTo(request.CreatedAt) >= 0); } return(query .Select(activity => _mapper.Map <UserActivityResponseDto>(activity)) .GetPaged(request.Page, request.Size)); }
public Page <UserActivityResponseDto> Get([FromQuery] UserActivitySearchDto request) { return(_userActivityService.FindAll(request)); }