This is the Blue10 .NET Core SDK.
- To start using Blue10 you first need an environment and API key. Both will be generated by Blue10 Contact Blue 10.
- During the API key creation process our staff will assess which features your application requires and will attach that feature set to your Blue10 environment.
- Log in to your Blue10 environment and create a new Company via Settings -> Companies -> New company. Give the company a name and pick the ERP system
API
. The next screen will directly show, choose the feature set as created in the previous step.
For this example we will create a simple console adapter that synchronises vendor information.
In the main Program.cs you will see this:
using System;
namespace GettingStartedWithBlue10
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
dotnet add package Blue10SDK --version 0.1.5
using System;
class Program
{
static void Main(string[] args)
{
//Build our blue10 client service
var b10client = Blue10.CreateClient("<Your personal API Key>");
//or the simple async alternative
var b10AsyncClient = Blue10.CreateAsyncClient("<Your personal API Key>");
}
}
//When configuring ASP.Net Core , Azure Functions or IHosterService projects
public void ConfigureServices(IServiceCollection services)
{
service.AddBlue10("<Your personal API Key>")
//..
//Other services
}
// And then use the client through dependency injection:
public class MyClass
{
readonly IBlue10AsyncClient client;
public MyClass(IBlue10AsyncClient _blue10Client)
{
client = _blue10Client;
}
}
using System;
namespace GettingStartedWithBlue10
{
class Program
{
static void Main(string[] args)
{
//Build our blue10 client service
var b10client = Blue10.CreateClient("<Your personal API Key>");
//retreive your company
var myCompanyId = b10client
.GetCompanies()
.FirstOrDefault(x => x.id == "<MyCompany>");
//Create some vendors
var vendors = new List<Vendor>
{
new Vendor{
id_company = myCompanyId.id,
administration_code = "1",
name = "Albert Heijn"
},
new Vendor{
id_company = myCompanyId.id,
administration_code = "2",
name = "Jumbo"
},
new Vendor{
id_company = myCompanyId.id,
administration_code = "3",
name = "Coop"
}
};
//Add vendors to blue10
vendors.ForEach(x => b10client.AddVendor(x));
Console.WriteLine("Done");
}
}
}