Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

wis3guy/FindsiClient.Net

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

FindsiClient.Net

Specialized http client and a set of convenient extensions for communicating with the Findsi API

Findsi

Usage

At application start-up (ie. Main() or Application_Start()) set up the FindsiHalHttpClientFactory:

// Create the default parser
IHalJsonParser parser = new HalJsonParser();

// Create the settings
var settings = new FindsiClientSettings {Key = Key, BaseAddress = _APIUri};

// Create the factory
IHalHttpClientWithRootFactory factory = new FindsiHalHttpClientFactory(parser, settings);

The factory is now ready for use and can be held, in your IoC container of choice, within singleton scope.

Within your code, you can now use the factory to create your clients as follows:

using (var client = _factory.CreateClientWithRoot())
{
	var resource = await client.ActorList();
	
	// do something with the retrieved data ...
}

Note that the client is disposable!

The object graph returned -- which is defined in the HalClient.Net library -- by the client is a generic representation of the object, that makes contained data elements easy to traverse/access. For convenience some extension methods have been added that simplify the projection of an IResourceObject into an Identifier or a RankedIdentifier.

var target = new Identifier { Id = "3717492", Classification = "article" };

using (var client = _factory.CreateClientWithRoot())
{
	var resource = await client.TargetDetail(target);
	var identifier = resource.AsIdentifier();
	
	// do something with the identifier ...
}

Work in progress

Findsi is currently in beta, as such this library will inevitably change every time the API does.

About

A client that simplifies developing applications that log to and consume data from the Findsi API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published