FleetControlIdConverter 1.2.0
dotnet add package FleetControlIdConverter --version 1.2.0
NuGet\Install-Package FleetControlIdConverter -Version 1.2.0
<PackageReference Include="FleetControlIdConverter" Version="1.2.0" />
<PackageVersion Include="FleetControlIdConverter" Version="1.2.0" />
<PackageReference Include="FleetControlIdConverter" />
paket add FleetControlIdConverter --version 1.2.0
#r "nuget: FleetControlIdConverter, 1.2.0"
#:package FleetControlIdConverter@1.2.0
#addin nuget:?package=FleetControlIdConverter&version=1.2.0
#tool nuget:?package=FleetControlIdConverter&version=1.2.0
Asset Id Converter
This is a library that can handle conversions of the unique ID of an asset from FleetControl.
Since FleetControl V2 only supports GUID's as an unique identifier for an asset, tables have been made in azure that have records to match the new asset ID's to their original counterparts.
It is possible to convert from the old ID (integer) to the new (GUID), and vice-versa.
Asset support
Currently this package supports the following IDs:
- Company
- Employee
- Trailer
- Vehicle
Usage example
Version 1.2.0 and up
Dependancy inject by using:
builder.Services.AddScoped<IFCAssetIdConverter, FCAssetIdConverter>();
Make sure the AzureStorageClient package has been updated to at least 1.3.0
Version 1.1.8 to 1.1.9
Dependancy inject by using:
builder.Services.AddScoped<IFCAssetIdConverter, FCAssetIdConverter>();
After this nothing else has to be added, make sure the AzureStorageClient package has been updated to at least version 1.2.0, and the storage environment for Production has been set up correctly
To use the converter you can use the following:
assetIdConverter.GetNewId(1, EntityType.Company) // Will try to search the new GUID value of the company
or
assetIdConverter.GetOldId(Guid.Parse("8102fc13-9fac-4bd8-132f-08daf273818c"), EntityType.Company) // Will try to search the old int value of the company
The supported entity types are:
- Company
- Employee
- Trailer
- Vehicle
- Activity
Version 1.1.3 and up
Dependancy inject by using:
builder.Services.AddScoped<IFCAssetIdConverter, FCAssetIdConverter>();
In your IServiceCollection configuration add the following:
Services.AddOptions<IdConverterConfiguration>().Configure<IConfiguration>((settings, configuration) =>
{
configuration.GetSection("IdConverterConfiguration").Bind(settings);
});
then in your user secrets:
"IdConverterConfiguration": {
"AccountName": "YOUR_ACCOUNT_NAME"
},
Version 1.1.2 and lower
! First make sure the AssetIdConverter is injected by dependancy injection, and you have the azure table service injected !
# returns the old company id
int oldCompanyId = await assetIdConverter.GetOldCompanyId(newCompanyGuid, azureTableService)
# returns the new company id
Guid newCompanyId = await assetIdConverter.GetNewCompanyId(oldCompanyId, azureTableService)
Running Tests
To be able to run the unit tests, make sure you have Azurite running on your PC, as it will use the local development environment.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Azure.Data.Tables (>= 12.11.0)
- Azure.Identity (>= 1.14.2)
- AzureStorageClient (>= 1.3.0)
- Microsoft.Extensions.Options (>= 9.0.8)
- System.Linq.Async (>= 6.0.3)
-
net9.0
- Azure.Data.Tables (>= 12.11.0)
- Azure.Identity (>= 1.14.2)
- AzureStorageClient (>= 1.3.0)
- Microsoft.Extensions.Options (>= 9.0.8)
- System.Linq.Async (>= 6.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.2.0 | 146 | 8/11/2025 |
1.1.9 | 366 | 11/26/2024 |
1.1.7 | 205 | 10/2/2024 |
1.1.6 | 278 | 4/4/2024 |
1.1.5 | 120 | 4/4/2024 |
1.1.4 | 124 | 4/4/2024 |
1.1.3 | 139 | 3/27/2024 |
1.1.2 | 352 | 3/14/2024 |
1.1.1 | 127 | 3/14/2024 |
1.1.0 | 134 | 3/7/2024 |
1.0.28 | 427 | 1/12/2024 |
1.0.25 | 166 | 1/9/2024 |
1.0.2 | 135 | 1/9/2024 |
1.0.1 | 137 | 1/9/2024 |
1.0.0 | 170 | 1/4/2024 |