Appearance
AireFrame SDK
We publish a C# ASP.Net Core SDK that can be used to integrate AireFrame with custom data sources.
Currently the SDK supports .NET 8 upwards.
Installation
The SDK is published to a custom AzureDevops package feed. To access it you need to add a NuGet.config file to your project with the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AireFrame" value="https://pkgs.dev.azure.com/AireLogic/Public/_packaging/AireFrame/nuget/v3/index.json" />
</packageSources>
</configuration>Then install the package into your project.
Install-Package AireLogic.AireFrame.DataProviderSdkOr:
dotnet add package AireLogic.AireFrame.DataProviderSdkUsage
The main interface you need to implement is IStructuredDataProvider.
In Startup.ConfigureServices:
services
.AddDataProviderServer<YourDataSource>(
new DataProviderServerSettings(
new AuthOptions(
AUTHORITY_HOST,
ISSUER_HOST,
AUDIENCE)
)
)
.AddStructuredDataProvider<YourStructuredDataProviderImplementation>(o => {
// This adds the IDataChangeNotificationClient which enables caching of structured data
options.ServerConfiguration = new AireFrameServerConfiguration(GrpcEndpoint, ClientCredentials);
});In Startup.Configure:
app.UseDataProviderServer();
..
app.UseEndpoints(endpoints =>
{
endpoints.MapDataProvider();
});Authentication
To setup authentication for your service you need to create an client and a scope on the authority server that AireFrame is using. For cloud-hosted AireFrame production this is AireIdentity
This address is what you need to provide for both the AUTHORITY_HOST and ISSUER_HOST values. The scope you created will be the AUDIENCE value.
Storage Libraries
In order to make it easier to implement the SDK we have created a storage library that can be used to store data in a Postgres database. This is available as NuGet package AireLogic.AireFrame.DataProvider.Storage.PostgreSql.
To use this add the following to your DbContext:
csharp
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.AddDataProviderEntities();
}And register the services:
csharp
services.AddDataProviderPostgresStorage((sp, _) => sp.GetRequiredService<DbContext>());Code Generation Library
We have also created a code generation library that can be used to generate the boilerplate code for the SDK. This is available as NuGet package AireLogic.AireFrame.DataProviderSdk.Analyzers.
To use this library, add the package to your csproj:
xml
<PackageReference Include="AireLogic.AireFrame.DataProviderSdk.Analyzers" Version="..">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>When one or more [DataPointItem("key")] attributes are added to members on a partial class, the library will automatically generate a GetDataPointItems method on that class that will convert the members to DataPointItems.