public string GetSearchRecords(string searchQuery, Type entityType = null, SearchSortType sortType = null) { if(string.IsNullOrWhiteSpace(searchQuery)) { throw new ArgumentNullException("Null Parameter searchQuery"); } var url = string.Format("search.json?query={0}", searchQuery); var req = new RestRequest(url); var resp = _client.Execute(req); return resp.Content; }
public Task<string> SearchAsync(string searchQuery, Type entityType = null, SearchSortType sortType = null) { if(string.IsNullOrWhiteSpace(searchQuery)) { throw new ArgumentNullException("Invalid Parameter: searchQuery"); } return Task.Factory.StartNew<string>(() => { return GetSearchRecords(searchQuery); }); }