Example #1
0
        public Uri GenerateRequestUrl(Type type, string query = "*", int start = 0, int limit = 100)
        {
            string metaTypeName = GetMetaTypeName(type);

            var ftsQueryRequest = new FTSQueryRequest
            {
                Statements = new List <Statement>
                {
                    new Statement {
                        Query = query
                    }
                },
                Start = start,
                Limit = limit
            };

            var ftsQueryRequestString = JsonConvert.SerializeObject(ftsQueryRequest);

            var uri = FTSSearchTemplate.BindByName(BaseAddress,
                                                   new Dictionary <string, string>()
            {
                { "metaType", metaTypeName },
                { "query", ftsQueryRequestString }
            });

            return(uri);
        }
		public Uri GenerateRequestUrl(Type type, IList<string> queryStrings, int start = 0, int limit = 10)
		{
			string metaTypeName = GetMetaTypeName(type);

		    var statements = queryStrings.Select(query => new Statement
		    {
		        Query = query
		    }).ToList();

		    var ftsQueryRequest = new FTSQueryRequest
			{
				Statements = statements,
				Start = start,
				Limit = limit
			};

			var ftsQueryRequestString = JsonConvert.SerializeObject(ftsQueryRequest);

			var uri = FTSSearchTemplate.BindByName(BaseAddress,
				new Dictionary<string, string>
				{
					{ "metaType", metaTypeName },
					{ "query", ftsQueryRequestString }
				});

			return uri;
		}