Yanga.Module.Location.Wrapper
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Yanga.Module.Location.Wrapper --version 1.0.0
NuGet\Install-Package Yanga.Module.Location.Wrapper -Version 1.0.0
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="Yanga.Module.Location.Wrapper" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yanga.Module.Location.Wrapper" Version="1.0.0" />
<PackageReference Include="Yanga.Module.Location.Wrapper" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Yanga.Module.Location.Wrapper --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Yanga.Module.Location.Wrapper, 1.0.0"
#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.
#addin nuget:?package=Yanga.Module.Location.Wrapper&version=1.0.0
#tool nuget:?package=Yanga.Module.Location.Wrapper&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Yanga Location Wrapper
Prerequisites
- .NET 9
Getting Started
- Clone the repository:
- Open the solution in Visual Studio:
- Update the
appsettings.json
file with your API key: - Build and run the project:
Dependency injection
builder.Services.AddLocationService(builder.Configuration);
Injection
private readonly ILocationApiWrapper _locationApiWrapper;
public LocationController(ILogger<LocationController> logger, ILocationApiWrapper locationApiWrapper, IOptions<LocationSettings> locationSettings)
{
_logger = logger;
_locationSettings = locationSettings.Value ?? throw new ArgumentNullException(nameof(locationSettings));
_locationApiWrapper = locationApiWrapper;
}csharp```csharp
Methods
Cities:
_locationApiWrapper.GetCitiesAsync
Query Parameters:
pageNumber
(int): The page number (1-based).pageSize
(int): The number of items per page.fields
(string): Comma-separated fields to include, or "all".sortField
(string, optional): Field to sort by.sortOrder
(int, optional): Sort order: 1 (ascending), -1 (descending), null (default).countryCode
(string, optional): Country code filter.minPopulation
(long): Minimum population filter.
Exemple
var result = await _locationApiWrapper.GetCitiesAsync(
new YangaModuleLocationGetCitiesPaginatedRequest
{
ApiKey = apiKey,
Language = "de",
PageNumber = 1,
PageSize = 10,
SortField = null,
SortOrder = null,
CountryCode = "de",
MinPopulation = 0,
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Mapster (>= 7.4.0)
- Microsoft.Extensions.Http (>= 9.0.3)
- Yanga.Module.Results (>= 1.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.