Query.Query C# (CSharp) Method

Query() public method

public Query ( string IP, int port ) : System
IP string
port int
return System
    public Query(string IP, int port)
    {
        qSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

            qSocket.SendTimeout = 5000;
            qSocket.ReceiveTimeout = 5000;

            try
            {
                address = Dns.GetHostAddresses(IP)[0];
            }

            catch
            {

            }

            _port = port;
    }

Usage Example

Beispiel #1
0
        public async Task <Paged <Role> > PagingAsync(ContextModel context, Paging paging)
        {
            var paged = await Query
                        .Query(
                filter : (items) =>
            {
                items = items.QueryByPermission(context);
                items = items.QueryByDeletedBy();

                if (!string.IsNullOrEmpty(paging.Q))
                {
                    var q = paging.Q.ToUpper();
                    items = items.Where(x => x.NormalizedName.Contains(q));
                }

                if (paging.Search != null)
                {
                    foreach (var item in paging.Search)
                    {
                        items = items.Contains(item.Key, item.Value);
                    }
                }

                if (paging.Sort != null)
                {
                    items = items.OrderBy(paging.Sort);
                }

                if (paging.Columns != null)
                {
                    items = items.Select(paging.Columns
                                         .Where(x => x.Value)
                                         .Select(x => x.Key)
                                         .ToArray());
                }

                return(items);
            },
                order : x => x.OrderByDescending(y => y.CreatedAt),
                include : null)
                        .ToPaginationAsync(paging);

            return(paged);
        }
All Usage Examples Of Query::Query