FleetControlIdConverter 1.2.0

dotnet add package FleetControlIdConverter --version 1.2.0
                    
NuGet\Install-Package FleetControlIdConverter -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FleetControlIdConverter" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FleetControlIdConverter" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="FleetControlIdConverter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FleetControlIdConverter --version 1.2.0
                    
#r "nuget: FleetControlIdConverter, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FleetControlIdConverter@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FleetControlIdConverter&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=FleetControlIdConverter&version=1.2.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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