Skip to content

steffenskov/Geoapify.SDK

Repository files navigation

Geoapify.SDK

A FOSS SDK for Geoapify's API written in .Net.

Usage

I strongly suggest using Dependency Injection via the package Geoapify.DependencyInjection like this:

var apiKey = "YOUR_KEY"; // Probably read this from a secret somewhere

services.AddGeoapify(apiKey);

And you'll have access to the IGeoapifyClient in your Dependency Injection system.

Furthermore if you want updates to addresses as they change (addresses do change over time, albeit not often), you should add both Geoapify.Storage and a form of database (e.g. Geoapify.Storage.MongoDB or provide one yourself, see the notes for the Storage package).

This allows you to store a copy of any relevant addresses locally (in your database), and have a service continuously check for changes to that address and inform you of those.

A full example of that configuration:

var apiKey = "YOUR_KEY"; // Probably read this from a secret somewhere
var client = new MongoClient(mongoConnectionstring);
var db = client.GetDatabase("your-database");

services.AddGeoapify(apiKey) // Injects the IGeoapifyClient
        .AddMongoDBStorage(db, "address-collection-name") // Injects an IAddressRepository for MongoDB
        .AddStorageUpdaterService() // Injects the StorageUpdaterService that'll check for updates to addresses
        .AddAddressChangedHandler<MyHandler>(); // Inject a handler to be invoked whenever an address is updated by the StorageUpdaterService

Documentation

Auto generated documentation via DocFx is available here: https://steffenskov.github.io/Geoapify.SDK/

About

A FOSS SDK for Geoapify's API written in .Net.

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors