Esempio n. 1
0
 protected override object SearchObjects(AObjects aObjects)
 {
     var channels = from server in Helper.Servers.All from channel in server.Channels select channel;
     var objs = Helper.XgObjectsToNancyObjects(channels);
     var result = new Result.Objects { Results = objs, ResultCount = objs.Count() };
     return CreateSuccessResponseAndUpdateApiKey(result);
 }
Esempio n. 2
0
        protected virtual object SearchObjects(AObjects aObjects)
        {
            var objs   = Helper.XgObjectsToNancyObjects(aObjects.Children);
            var result = new Result.Objects {
                Results = objs, ResultCount = objs.Count()
            };

            return(CreateSuccessResponseAndUpdateApiKey(result));
        }
Esempio n. 3
0
        object ExecuteSearchRequest(Request.PacketSearch request)
        {
            try
            {
                var result  = new Result.Objects();
                var results = Webserver.Search.Packets.GetResults(new XG.Model.Domain.Search {
                    Name = request.SearchTerm, Size = request.Size
                }, request.ShowOfflineBots, (request.Page - 1) * request.MaxResults, request.MaxResults, request.SortBy, request.Sort == "desc");
                result.Results     = Helper.XgObjectsToNancyObjects(from packets in results.Packets from packet in packets.Value select packet).Cast <Nancy.Api.Model.Domain.Packet>();
                result.ResultCount = results.Total;

                return(CreateSuccessResponseAndUpdateApiKey(result));
            }
            catch (Exception ex)
            {
                return(CreateErrorResponseAndUpdateApiKey(ex.Message));
            }
        }
Esempio n. 4
0
        object ExecuteSearchRequest(Request.PacketSearch request)
        {
            try
            {
                var result = new Result.Objects();
                var results = Webserver.Search.Packets.GetResults(new XG.Model.Domain.Search { Name = request.SearchTerm, Size = request.Size }, request.ShowOfflineBots, (request.Page - 1) * request.MaxResults, request.MaxResults, request.SortBy, request.Sort == "desc");
                result.Results = Helper.XgObjectsToNancyObjects(from packets in results.Packets from packet in packets.Value select packet).Cast<Nancy.Api.Model.Domain.Packet>();
                result.ResultCount = results.Total;

                return CreateSuccessResponseAndUpdateApiKey(result);
            }
            catch (Exception ex)
            {
                return CreateErrorResponseAndUpdateApiKey(ex.Message);
            }
        }
Esempio n. 5
0
 protected virtual object SearchObjects(AObjects aObjects)
 {
     var objs = Helper.XgObjectsToNancyObjects(aObjects.Children);
     var result = new Result.Objects { Results = objs, ResultCount = objs.Count() };
     return CreateSuccessResponseAndUpdateApiKey(result);
 }