Pandorax.Loqate 0.0.0-alpha002

This is a prerelease version of Pandorax.Loqate.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Pandorax.Loqate --version 0.0.0-alpha002                
NuGet\Install-Package Pandorax.Loqate -Version 0.0.0-alpha002                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pandorax.Loqate" Version="0.0.0-alpha002" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pandorax.Loqate --version 0.0.0-alpha002                
#r "nuget: Pandorax.Loqate, 0.0.0-alpha002"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pandorax.Loqate as a Cake Addin
#addin nuget:?package=Pandorax.Loqate&version=0.0.0-alpha002&prerelease

// Install Pandorax.Loqate as a Cake Tool
#tool nuget:?package=Pandorax.Loqate&version=0.0.0-alpha002&prerelease                

Pandorax.Loqate

Pandorax.Loqate is a .NET library that provides easy integration with the Loqate API for address verification, geocoding, and other location-based services.

Table of Contents

Getting Started

Prerequisites

An API key is needed from Loqate

Installation

You can install Pandorax.Loqate via NuGet Package Manager or .NET CLI.

NuGet Package Manager:
Install-Package Pandorax.Loqate
.NET CLI:
dotnet add package Pandorax.Loqate

Usage

To get started using Pandorax.Loqate, follow these steps:

Configuration

Make sure to have the API key available to your application configuration, whether it be in your user secrets, appsettings.json, or another configuration provider you have configured.

Adding Services to Dependency Injection Container

To use Pandorax.Loqate with dependency injection, you need to register the required services in your application's dependency injection container.

Example for ASP.NET Core:

In an ASP.NET Core application's Program.cs, add the following code after initialising the WebApplicationBuilder:

builder.Services
    .Configure<LoqateOptions>(options =>
    {
        options.Key = builder.Configuration["Loqate:ApiKey"];
    })
    .AddLoqate();
Injecting the Loqate Service

Once you have registered the LoqateService with the dependency injection container, you can inject it into your classes where needed.

Example Usage in a Controller:
using Pandorax.Loqate;

[ApiController]
[Route("[controller]")]
public class AddressController : ControllerBase
{
    private readonly ILoqateService _loqateService;

    public AddressController(ILoqateService loqateService)
    {
        _loqateService = loqateService;
    }

    [HttpGet]
    public async Task<IActionResult> FindAddresses(string text)
    {
        FindRequestParameters requestParameters = new(text)
        {
            Countries = ["GB"]
        };

        FindResponse addresses = await _loqateService.FindAddressesAsync(requestParameters);

        return Ok(addresses);
    }
}

In this example, the ILoqateService is injected into the AddressController, allowing the controller to use the Loqate service for address lookup.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.0.0-alpha004 209 5/16/2024
0.0.0-alpha003 60 5/16/2024
0.0.0-alpha002 60 5/15/2024
0.0.0-alpha001 65 5/15/2024