Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagedRedirectResponseAllOf" /> class.
 /// </summary>
 /// <param name="requestStatus">The status of the request..</param>
 /// <param name="orderId">Note - Client Order ID if supplied by client which should not contain any special characters or spaces. If not supplied by client, IPG will generate. The first 12 alphanumeric digits are passed down to Fiserv Enterprise reporting tool, Clientline and Data File Manager (DFM)..</param>
 /// <param name="redirectURL">URL for embedded payment link..</param>
 /// <param name="transactionId">ID code from the transaction..</param>
 public ManagedRedirectResponseAllOf(RequestStatusEnum?requestStatus = default(RequestStatusEnum?), string orderId = default(string), string redirectURL = default(string), string transactionId = default(string))
 {
     this.RequestStatus = requestStatus;
     this.OrderId       = orderId;
     this.RedirectURL   = redirectURL;
     this.TransactionId = transactionId;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentUrlResponseAllOf" /> class.
 /// </summary>
 /// <param name="requestStatus">Request status. If it is anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="orderId">Note - Client Order ID if supplied by client. If not supplied by client, IPG will generate. The first 12 alphanumeric digits are passed down to Fiserv Enterprise reporting tool, Clientline and Data File Manager (DFM)..</param>
 /// <param name="paymentUrl">URL for embedded payment link..</param>
 /// <param name="transactionId">ID code from the transaction..</param>
 public PaymentUrlResponseAllOf(RequestStatusEnum?requestStatus = default(RequestStatusEnum?), string orderId = default(string), string paymentUrl = default(string), string transactionId = default(string))
 {
     this.RequestStatus = requestStatus;
     this.OrderId       = orderId;
     this.PaymentUrl    = paymentUrl;
     this.TransactionId = transactionId;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CardInfoLookupResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="cardDetails">One or more card information retrieved based on BIN..</param>
 /// <param name="requestStatus">Request status..</param>
 public CardInfoLookupResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = null, List <CardInfo> cardDetails = default(List <CardInfo>), RequestStatusEnum?requestStatus = null)
 {
     this.ClientRequestId = clientRequestId;
     this.ApiTraceId      = apiTraceId;
     this.ResponseType    = responseType;
     this.CardDetails     = cardDetails;
     this.RequestStatus   = requestStatus;
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InitiateClearingResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">Request status. If it is anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="clearingDetails">clearingDetails.</param>
 /// <param name="endpointResponses">The array holds response information of the involved endpoints..</param>
 public InitiateClearingResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = null, RequestStatusEnum?requestStatus = null, ClearingDetails clearingDetails = default(ClearingDetails), List <EndpointResponse> endpointResponses = default(List <EndpointResponse>))
 {
     this.ClientRequestId   = clientRequestId;
     this.ApiTraceId        = apiTraceId;
     this.ResponseType      = responseType;
     this.RequestStatus     = requestStatus;
     this.ClearingDetails   = clearingDetails;
     this.EndpointResponses = endpointResponses;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentTokenUpdateResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">The status of the request..</param>
 /// <param name="requestTime">Time of the request..</param>
 /// <param name="errors">errors.</param>
 public PaymentTokenUpdateResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = null, RequestStatusEnum?requestStatus = null, long requestTime = default(long), List <Error> errors = default(List <Error>))
 {
     this.ClientRequestId = clientRequestId;
     this.ApiTraceId      = apiTraceId;
     this.ResponseType    = responseType;
     this.RequestStatus   = requestStatus;
     this.RequestTime     = requestTime;
     this.Errors          = errors;
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentSchedulesResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">Result of requested operation. If it&#39;s anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="orderId">Client order ID if supplied by client, otherwise the order ID..</param>
 /// <param name="transactionResponse">transactionResponse.</param>
 public PaymentSchedulesResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = null, RequestStatusEnum?requestStatus = null, string orderId = default(string), TransactionResponse transactionResponse = default(TransactionResponse))
 {
     this.ClientRequestId     = clientRequestId;
     this.ApiTraceId          = apiTraceId;
     this.ResponseType        = responseType;
     this.RequestStatus       = requestStatus;
     this.OrderId             = orderId;
     this.TransactionResponse = transactionResponse;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagedRedirectResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">The status of the request..</param>
 /// <param name="orderId">Note - Client Order ID if supplied by client which should not contain any special characters or spaces. If not supplied by client, IPG will generate. The first 12 alphanumeric digits are passed down to Fiserv Enterprise reporting tool, Clientline and Data File Manager (DFM)..</param>
 /// <param name="redirectURL">URL for embedded payment link..</param>
 /// <param name="transactionId">ID code from the transaction..</param>
 public ManagedRedirectResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = default(ResponseType?), RequestStatusEnum?requestStatus = default(RequestStatusEnum?), string orderId = default(string), string redirectURL = default(string), string transactionId = default(string))
 {
     this.ClientRequestId = clientRequestId;
     this.ApiTraceId      = apiTraceId;
     this.ResponseType    = responseType;
     this.RequestStatus   = requestStatus;
     this.OrderId         = orderId;
     this.RedirectURL     = redirectURL;
     this.TransactionId   = transactionId;
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentSchedulesErrorResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">Result of requested operation. If it&#39;s anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="orderId">Note - Client Order ID if supplied by client. If not supplied by client, IPG will generate. The first 12 alphanumeric digits are passed down to Fiserv Enterprise reporting tool, Clientline and Data File Manager (DFM)..</param>
 /// <param name="transactionResponse">transactionResponse.</param>
 /// <param name="error">error.</param>
 public PaymentSchedulesErrorResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = default(ResponseType?), RequestStatusEnum?requestStatus = default(RequestStatusEnum?), string orderId = default(string), TransactionResponse transactionResponse = default(TransactionResponse), Error error = default(Error))
 {
     this.ClientRequestId     = clientRequestId;
     this.ApiTraceId          = apiTraceId;
     this.ResponseType        = responseType;
     this.RequestStatus       = requestStatus;
     this.OrderId             = orderId;
     this.TransactionResponse = transactionResponse;
     this.Error = error;
 }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentUrlResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">Request status. If it is anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="orderId">Client order ID if supplied by client, otherwise the order ID..</param>
 /// <param name="paymentUrl">URL for embedded payment link..</param>
 /// <param name="transactionId">ID code from the transaction..</param>
 public PaymentUrlResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = null, RequestStatusEnum?requestStatus = null, string orderId = default(string), string paymentUrl = default(string), string transactionId = default(string))
 {
     this.ClientRequestId = clientRequestId;
     this.ApiTraceId      = apiTraceId;
     this.ResponseType    = responseType;
     this.RequestStatus   = requestStatus;
     this.OrderId         = orderId;
     this.PaymentUrl      = paymentUrl;
     this.TransactionId   = transactionId;
 }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentUrlErrorResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">Request status. If it is anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="orderId">Note - Client Order ID if supplied by client. If not supplied by client, IPG will generate. The first 12 alphanumeric digits are passed down to Fiserv Enterprise reporting tool, Clientline and Data File Manager (DFM)..</param>
 /// <param name="paymentUrl">URL for embedded payment link..</param>
 /// <param name="transactionId">ID code from the transaction..</param>
 /// <param name="error">error.</param>
 public PaymentUrlErrorResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = default(ResponseType?), RequestStatusEnum?requestStatus = default(RequestStatusEnum?), string orderId = default(string), string paymentUrl = default(string), string transactionId = default(string), Error error = default(Error))
 {
     this.ClientRequestId = clientRequestId;
     this.ApiTraceId      = apiTraceId;
     this.ResponseType    = responseType;
     this.RequestStatus   = requestStatus;
     this.OrderId         = orderId;
     this.PaymentUrl      = paymentUrl;
     this.TransactionId   = transactionId;
     this.Error           = error;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentTokenizationResponseAllOf" /> class.
 /// </summary>
 /// <param name="requestStatus">The status of the request..</param>
 /// <param name="requestTime">Time of the request..</param>
 /// <param name="brand">Card brand..</param>
 /// <param name="country">Country of the card issued..</param>
 /// <param name="paymentToken">paymentToken.</param>
 /// <param name="paymentCard">paymentCard.</param>
 /// <param name="processor">processor.</param>
 /// <param name="orderId">Client order ID if supplied by client, otherwise the order ID..</param>
 /// <param name="ipgTransactionId">The response transaction ID..</param>
 /// <param name="merchantTransactionId">The unique merchant transaction ID from the request header, if supplied..</param>
 public PaymentTokenizationResponseAllOf(RequestStatusEnum?requestStatus = null, long requestTime = default(long), string brand = default(string), string country = default(string), PaymentTokenDetails paymentToken = default(PaymentTokenDetails), PaymentCard paymentCard = default(PaymentCard), ProcessorData processor = default(ProcessorData), string orderId = default(string), string ipgTransactionId = default(string), string merchantTransactionId = default(string))
 {
     this.RequestStatus         = requestStatus;
     this.RequestTime           = requestTime;
     this.Brand                 = brand;
     this.Country               = country;
     this.PaymentToken          = paymentToken;
     this.PaymentCard           = paymentCard;
     this.Processor             = processor;
     this.OrderId               = orderId;
     this.IpgTransactionId      = ipgTransactionId;
     this.MerchantTransactionId = merchantTransactionId;
 }
Beispiel #12
0
        public List <RequestListDto> GetAgentRequest(string userId, RequestStatusEnum?status, RequestTypeEnum?type, int pageSize, int pageNumber)
        {
            var queryable = _context.Requests
                            .Include(u => u.User)
                            .Include(u => u.Agent)
                            .Include(u => u.City)
                            .Where(res =>
                                   (!res.IsHidden) &&
                                   (status != RequestStatusEnum.New || res.UserId != null) &&
                                   (res.Type == type || type == 0));

            if (status != null && status == RequestStatusEnum.Canceled)
            {
                var canceledRequests = GetAllAgentCanceledRequest(userId);
                queryable = queryable.Where(u => canceledRequests.Contains(u.Id));
            }

            else
            {
                queryable = queryable.Where(res => res.AgentId == userId && res.Status == status || status == 0);
            }

            return(queryable
                   .OrderByDescending(res => res.Id).Skip(pageSize * pageNumber)
                   .Take(pageSize)
                   .Select(u => new RequestListDto()
            {
                Id = u.Id,
                Address = u.Address,
                AgentId = u.AgentId,
                UserId = u.UserId,
                AgentUserName = u.Agent.UserName,
                AgentFullName = u.Agent.FullName,
                UserName = u.User.UserName,
                UserFullName = u.User.FullName,
                CityId = u.CityId,
                CityName = u.City.Name,
                Status = u.Status,
                Type = u.Type,
                ToLocation = u.ToLocation,
                FromLocation = u.FromLocation,
                CreatedDate = u.CreatedDate,
                Price = u.Price,
                IsHidden = u.IsHidden,
                UserPhoneNumber = u.User.PhoneNumber
            })

                   .ToList());
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentTokenizationResponse" /> class.
 /// </summary>
 /// <param name="clientRequestId">Echoes back the value in the request header for tracking..</param>
 /// <param name="apiTraceId">Request identifier in API, can be used to request logs from the support team..</param>
 /// <param name="responseType">responseType.</param>
 /// <param name="requestStatus">The status of the request..</param>
 /// <param name="requestTime">Time of the request..</param>
 /// <param name="brand">Card brand..</param>
 /// <param name="country">Country of the card issued..</param>
 /// <param name="paymentToken">paymentToken.</param>
 /// <param name="paymentCard">paymentCard.</param>
 /// <param name="processor">processor.</param>
 /// <param name="orderId">Note - Client Order ID if supplied by client. If not supplied by client, IPG will generate. The first 12 alphanumeric digits are passed down to Fiserv Enterprise reporting tool, Clientline and Data File Manager (DFM)..</param>
 /// <param name="ipgTransactionId">The response transaction ID..</param>
 /// <param name="merchantTransactionId">The unique merchant transaction ID from the request header, if supplied..</param>
 /// <param name="additionalResponseData">additionalResponseData.</param>
 public PaymentTokenizationResponse(string clientRequestId = default(string), string apiTraceId = default(string), ResponseType?responseType = default(ResponseType?), RequestStatusEnum?requestStatus = default(RequestStatusEnum?), long requestTime = default(long), string brand = default(string), string country = default(string), PaymentTokenDetails paymentToken = default(PaymentTokenDetails), PaymentCard paymentCard = default(PaymentCard), ProcessorData processor = default(ProcessorData), string orderId = default(string), string ipgTransactionId = default(string), string merchantTransactionId = default(string), AdditionalResponseData additionalResponseData = default(AdditionalResponseData))
 {
     this.ClientRequestId        = clientRequestId;
     this.ApiTraceId             = apiTraceId;
     this.ResponseType           = responseType;
     this.RequestStatus          = requestStatus;
     this.RequestTime            = requestTime;
     this.Brand                  = brand;
     this.Country                = country;
     this.PaymentToken           = paymentToken;
     this.PaymentCard            = paymentCard;
     this.Processor              = processor;
     this.OrderId                = orderId;
     this.IpgTransactionId       = ipgTransactionId;
     this.MerchantTransactionId  = merchantTransactionId;
     this.AdditionalResponseData = additionalResponseData;
 }
Beispiel #14
0
        public List <RequestListDto> GetAllAgentRequest(RequestStatusEnum?status, RequestTypeEnum?type, int pageSize, int pageNumber, long cityId, string agentId)
        {
            var refusedIds = _context.RefuseRequests.Where(u => u.AgentId == agentId && u.UserId == null)
                             .Select(u => u.RequestId).ToList();

            return(_context.Requests
                   .Include(u => u.User)
                   .Include(u => u.Agent)
                   .Include(u => u.City)
                   .Where(res =>
                          (!res.IsHidden) &&
                          (status != RequestStatusEnum.New || res.UserId != null) &&
                          (res.Status == status || status == 0) &&
                          (res.CityId == cityId || cityId == 0) &&
                          (res.Type == type || type == 0) &&
                          !refusedIds.Contains(res.Id))
                   .OrderByDescending(res => res.Id)
                   .ThenBy(res => res.PassengerNumber)
                   .Select(u => new RequestListDto()
            {
                Id = u.Id,
                Address = u.Address,
                AgentId = u.AgentId,
                UserId = u.UserId,
                AgentUserName = u.Agent.UserName,
                AgentFullName = u.Agent.FullName,
                UserName = u.User.UserName,
                UserFullName = u.User.FullName,
                CityId = u.CityId,
                CityName = u.City.Name,
                Status = u.Status,
                Type = u.Type,
                ToLocation = u.ToLocation,
                FromLocation = u.FromLocation,
                CreatedDate = u.CreatedDate,
                Price = u.Price,
                IsHidden = u.IsHidden,
                UserPhoneNumber = u.User.PhoneNumber
            })
                   .Skip(pageSize * pageNumber)
                   .Take(pageSize).ToList());
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentSchedulesResponseAllOf" /> class.
 /// </summary>
 /// <param name="requestStatus">Result of requested operation. If it&#39;s anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="orderId">Client order ID if supplied by client, otherwise the order ID..</param>
 /// <param name="transactionResponse">transactionResponse.</param>
 public PaymentSchedulesResponseAllOf(RequestStatusEnum?requestStatus = null, string orderId = default(string), TransactionResponse transactionResponse = default(TransactionResponse))
 {
     this.RequestStatus       = requestStatus;
     this.OrderId             = orderId;
     this.TransactionResponse = transactionResponse;
 }
Beispiel #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CardInfoLookupResponseAllOf" /> class.
 /// </summary>
 /// <param name="cardDetails">One or more card information retrieved based on BIN..</param>
 /// <param name="requestStatus">Request status..</param>
 public CardInfoLookupResponseAllOf(List <CardInfo> cardDetails = default(List <CardInfo>), RequestStatusEnum?requestStatus = default(RequestStatusEnum?))
 {
     this.CardDetails   = cardDetails;
     this.RequestStatus = requestStatus;
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentTokenUpdateResponseAllOf" /> class.
 /// </summary>
 /// <param name="requestStatus">The status of the request..</param>
 /// <param name="requestTime">Time of the request..</param>
 /// <param name="errors">errors.</param>
 public PaymentTokenUpdateResponseAllOf(RequestStatusEnum?requestStatus = default(RequestStatusEnum?), long requestTime = default(long), List <Error> errors = default(List <Error>))
 {
     this.RequestStatus = requestStatus;
     this.RequestTime   = requestTime;
     this.Errors        = errors;
 }
Beispiel #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InitiateClearingResponseAllOf" /> class.
 /// </summary>
 /// <param name="requestStatus">Request status. If it is anything other than &#39;SUCCESS&#39;, please refer to 400s HTTP error codes or decline. See Error object for details..</param>
 /// <param name="clearingDetails">clearingDetails.</param>
 /// <param name="endpointResponses">The array holds response information of the involved endpoints..</param>
 public InitiateClearingResponseAllOf(RequestStatusEnum?requestStatus = null, ClearingDetails clearingDetails = default(ClearingDetails), List <EndpointResponse> endpointResponses = default(List <EndpointResponse>))
 {
     this.RequestStatus     = requestStatus;
     this.ClearingDetails   = clearingDetails;
     this.EndpointResponses = endpointResponses;
 }
Beispiel #19
0
        public List <RequestListDto> GetUserRequest(string userId, RequestStatusEnum?status, int pageSize, int pageNumber)
        {
            IQueryable <Request> queryable;

            if (status == null || status == 0)
            {
                var newRequests = _context.Requests
                                  .Include(u => u.User)
                                  .Include(u => u.Agent)
                                  .Include(u => u.City)
                                  .Where(res => (res.UserId == userId) && res.Type == RequestTypeEnum.Request &&
                                         (res.Status == RequestStatusEnum.New))
                                  .OrderByDescending(res => res.Id)
                                  .Skip((pageSize / 2) * pageNumber)
                                  .Take(pageSize / 2);

                var inProgressRequests = _context.Requests
                                         .Include(u => u.User)
                                         .Include(u => u.Agent)
                                         .Include(u => u.City)
                                         .Where(res => (res.UserId == userId) && res.Type == RequestTypeEnum.Request &&
                                                (res.Status == RequestStatusEnum.Inprogress))
                                         .OrderByDescending(res => res.Id)
                                         .Skip((pageSize / 2) * pageNumber)
                                         .Take(pageSize / 2);

                queryable = newRequests.Union(inProgressRequests).OrderBy(u => u.Status);
            }
            else
            {
                queryable = _context.Requests
                            .Include(u => u.User)
                            .Include(u => u.Agent)
                            .Include(u => u.City)
                            .Where(res => (res.UserId == userId) && res.Type == RequestTypeEnum.Request &&
                                   (res.Status == status || status == 0))
                            .OrderByDescending(res => res.Id)
                            .Skip(pageSize * pageNumber)
                            .Take(pageSize);
            }
            return(queryable.Select(u => new RequestListDto()
            {
                Id = u.Id,
                Address = u.Address,
                AgentId = u.AgentId,
                UserId = u.UserId,
                AgentUserName = u.Agent.UserName,
                AgentFullName = u.Agent.FullName,
                UserName = u.User.UserName,
                UserFullName = u.User.FullName,
                CityId = u.CityId,
                CityName = u.City.Name,
                Status = u.Status,
                Type = u.Type,
                ToLocation = u.ToLocation,
                FromLocation = u.FromLocation,
                CreatedDate = u.CreatedDate,
                Price = u.Price,
                IsHidden = u.IsHidden,
            }).ToList());
        }
Beispiel #20
0
        public IQueryable <RequestListDto> SearchRequests(string userId, string agentId, RequestTypeEnum?type,
                                                          RequestStatusEnum?status, long cityId, string keyword)
        {
            if (status.HasValue && status.Value == RequestStatusEnum.New)
            {
                var requests = _context.Requests
                               .Include(u => u.User)
                               .Include(u => u.City)

                               .Where(res => (string.IsNullOrEmpty(userId) || res.UserId == userId) &&
                                      (type == 0 || res.Type == type) &&
                                      (status == 0 || res.Status == status) &&
                                      (res.CityId == cityId || cityId == 0) &&
                                      (res.Description.Contains(keyword) || res.Address.Contains(keyword) ||
                                       res.ToLocation.Contains(keyword) || res.FromLocation.Contains(keyword) ||
                                       string.IsNullOrEmpty(keyword))
                                      )
                               .OrderBy(res => res.Id);

                return(requests.Select(u => new RequestListDto()
                {
                    Id = u.Id,
                    Address = u.Address,
                    AgentId = u.AgentId,
                    UserId = u.UserId,
                    AgentUserName = u.Agent.UserName,
                    AgentFullName = u.Agent.FullName,
                    UserName = u.User.UserName,
                    UserFullName = u.User.FullName,
                    CityId = u.CityId,
                    CityName = u.City.Name,
                    Status = u.Status,
                    Type = u.Type,
                    ToLocation = u.ToLocation,
                    FromLocation = u.FromLocation,
                    CreatedDate = u.CreatedDate,
                    Price = u.Price,
                    PassengerNumber = u.PassengerNumber,
                    IsHidden = u.IsHidden,
                    //Description = u.Description
                }));
            }



            return(_context.Requests
                   .Include(u => u.User)
                   .Include(u => u.Agent)
                   .Include(u => u.City)
                   .Where(res => (res.UserId == userId || string.IsNullOrEmpty(userId)) &&
                          (res.AgentId == agentId || string.IsNullOrEmpty(agentId)) &&
                          (res.Type == type || type == 0) &&
                          (res.Status == status || status == 0) &&
                          (res.CityId == cityId || cityId == 0)
                          &&
                          (res.Description.Contains(keyword) || res.Address.Contains(keyword) ||
                           res.ToLocation.Contains(keyword) || res.FromLocation.Contains(keyword) ||
                           string.IsNullOrEmpty(keyword))
                          )
                   .OrderBy(res => res.Id)
                   .Select(u => new RequestListDto()
            {
                Id = u.Id,
                Address = u.Address,
                AgentId = u.AgentId,
                UserId = u.UserId,
                AgentUserName = u.Agent.UserName,
                AgentFullName = u.Agent.FullName,
                UserName = u.User.UserName,
                UserFullName = u.User.FullName,
                CityId = u.CityId,
                CityName = u.City.Name,
                Status = u.Status,
                Type = u.Type,
                ToLocation = u.ToLocation,
                FromLocation = u.FromLocation,
                CreatedDate = u.CreatedDate,
                Price = u.Price,
                PassengerNumber = u.PassengerNumber,
                IsHidden = u.IsHidden,
            }));
        }