Loop54.Connector
4.0.1
See the version list below for details.
dotnet add package Loop54.Connector --version 4.0.1
NuGet\Install-Package Loop54.Connector -Version 4.0.1
<PackageReference Include="Loop54.Connector" Version="4.0.1" />
paket add Loop54.Connector --version 4.0.1
#r "nuget: Loop54.Connector, 4.0.1"
// Install Loop54.Connector as a Cake Addin #addin nuget:?package=Loop54.Connector&version=4.0.1 // Install Loop54.Connector as a Cake Tool #tool nuget:?package=Loop54.Connector&version=4.0.1
.NET-Connector
.NET Wrapper for Loop54 JSON V3 API
How to install
The Loop54 Connector is available for download as a NuGet package. For installation instructions, see https://www.nuget.org/packages/Loop54.Connector/.
Requires .NET Framework 4.5 or later alternatively .NET Standard 2.0 or later.
How to use
The Loop54 Connector is easily configured if running ASP.NET or ASP.NET Core.
ASP.NET Core
Simply add the following code to the service configuration in your startup.cs file:
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddLoop54("https://helloworld.54proxy.com");
// or services.AddLoop54(new Loop54Settings("https://helloworld.54proxy.com")); for more options
An ILoop54Client
is then injectable to your middleware or controllers. See official ms docs for more information about how that works.
ASP.NET
Call the following static method once in the beginning of you application life cycle. For example in the Application_Start
method in the Global.asax.cs file:
Loop54ClientManager.StartUp("https://helloworld.54proxy.com");
// or Loop54ClientManager.StartUp(new Loop54Settings("https://helloworld.54proxy.com")); for more options
The ILoop54Client
is then attainable with the following method:
ILoop54Client client = Loop54ClientManager.Client();
This ILoop54Client
could of course be handled by a dependency injection system. Simply register the instance as a singleton in the framework of your choice.
Using the ILoop54Client
The ILoop54Client
contains methods for making all public API calls to the Loop54 e-commerce search engine. It contains both synchronous and asynchronous variants of all methods.
string searchQuery = "banana";
SearchRequest request = new SearchRequest(searchQuery);
SearchResponse response = await _loop54Client.SearchAsync(request);
To add parameters to the SearchRequest
you could do this:
request.ResultsOptions.Skip = 0;
request.ResultsOptions.Take = 10;
request.ResultsOptions.AddDistinctFacet<string>("Manufacturer");
request.ResultsOptions.AddRangeFacet<double>("Price");
All other request types also have their own types to use:
var createEventRequest = new CreateEventsRequest(event);
var autoCompleteRequest = new AutoCompleteRequest(query);
var getRelatedEntitiesRequest = new GetRelatedEntitiesRequest(entityType, entityId);
var getEntitiesRequest = new GetEntitiesRequest();
var getEntitiesByAttributeRequest = new GetEntitiesByAttributeRequest(attributeName, attributeValue);
But wait! I'm not using ASP.NET Core or ASP.NET!
There is still hope for you. If not using the above mentioned frameworks you can implement some of the functionality yourself and use the client just as well. You will need to implement the IRemoteClientInfoProvider
interface and the IRemoteClientInfo
interface and after doing that you can create a new instance of ILoop54Client
like this:
IRemoteClientInfoProvider myRemoteClientInfoProvider = new MySuperAwesomeCustomRemoteClientInfoProvider();
Loop54Settings settings = new Loop54Settings("https://helloworld.54proxy.com");
ILoop54Client loop54Client = new Loop54Client(new RequestManager(settings), myRemoteClientInfoProvider);
And you are good to go!
Features
- Native support for search, autoComplete, createEvent, getEntities, getEntitiesByAttribute and getRelatedEntities call. With intuitive APIs to call them.
- Handles user identification using random-generated cookies.
- Uses X-Forwarded-For as client IP if it's available.
- Configurable HTTP timeout.
- GZIP support.
- Relays HTTP data to engine:
- Referer
- UserAgent
- Library version
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.0.1)
- Microsoft.AspNetCore.Http.Extensions (>= 2.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.1.0)
-
All Frameworks
- Newtonsoft.Json (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.3.2 | 144 | 10/9/2024 |
6.3.1 | 243 | 10/1/2024 |
6.3.0 | 3,574 | 12/18/2023 |
6.2.0 | 1,963 | 9/11/2023 |
6.1.0 | 2,562 | 1/27/2023 |
6.0.0 | 620 | 1/25/2023 |
5.9.1 | 1,578 | 11/15/2022 |
5.9.0 | 567 | 10/25/2022 |
5.8.0 | 629 | 9/15/2022 |
5.7.1 | 790 | 7/26/2022 |
5.7.0 | 471 | 7/21/2022 |
5.6.2 | 515 | 6/28/2022 |
5.6.1 | 481 | 6/27/2022 |
5.6.0 | 462 | 6/27/2022 |
5.5.0 | 6,320 | 12/6/2021 |
5.4.0 | 420 | 11/17/2021 |
5.3.1 | 366 | 11/15/2021 |
5.3.0 | 371 | 11/15/2021 |
5.2.0 | 781 | 9/29/2021 |
5.1.4 | 4,085 | 3/26/2020 |
5.1.3 | 587 | 1/28/2020 |
5.1.2 | 21,009 | 12/21/2018 |
5.1.1 | 710 | 12/20/2018 |
5.1.0 | 1,026 | 11/28/2018 |
5.0.4 | 783 | 11/26/2018 |
5.0.3 | 2,332 | 11/2/2018 |
5.0.2 | 791 | 10/29/2018 |
5.0.1 | 790 | 10/19/2018 |
5.0.0 | 829 | 9/14/2018 |
4.2.0 | 959 | 7/26/2018 |
4.1.0 | 1,072 | 7/10/2018 |
4.0.1 | 1,057 | 7/3/2018 |
4.0.0 | 1,104 | 6/24/2018 |
3.2.0 | 4,301 | 4/5/2018 |
3.1.0 | 1,119 | 3/2/2018 |
3.0.0 | 1,391 | 2/7/2018 |
2.1.0 | 1,174 | 1/22/2018 |
1.0.0 | 1,421 | 11/11/2016 |