Skip to content

Provides an api interface to the Binner Swarm Api.

License

Notifications You must be signed in to change notification settings

liuqun/Binner.SwarmApi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binner.SwarmApi

nuget nuget Build status

Provides an api interface to the Binner Swarm Api.

Description

A C# restful client for working with the open source Binner Swarm Api.

Usage

using Binner.SwarmApi;

var config = new SwarmApiConfiguration();
var client = new SwarmApiClient(config);

var response = await client.GetPartInformationAsync("LM358");
// process part information results

Error Handling

using Binner.SwarmApi;

var config = new SwarmApiConfiguration();
var client = new SwarmApiClient(config);

var response = await client.GetPartInformationAsync("LM358");
if (response.IsSuccessful)
{
	// process part information results
	foreach (var part in response.Response.Parts)
	{
		Console.WriteLine($"Part Number: {part.BasePartNumber}");
		Console.WriteLine($"Type: {part.PartType}");
		Console.WriteLine($"Mfr: {part.Manufacturer} = {part.ManufacturerPartNumber}");
		Console.WriteLine($"Datasheets: {string.Join(", ", part.DatasheetUrls)}");
		Console.WriteLine();
	}
} else {
	var x = 0;
	foreach (var error in response.Errors)
	{
			x++;
			Console.WriteLine($" [{x}] {error}");
	}
}

About

Provides an api interface to the Binner Swarm Api.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%