AzureAutoNumber 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AzureAutoNumber --version 1.1.0                
NuGet\Install-Package AzureAutoNumber -Version 1.1.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="AzureAutoNumber" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AzureAutoNumber --version 1.1.0                
#r "nuget: AzureAutoNumber, 1.1.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.
// Install AzureAutoNumber as a Cake Addin
#addin nuget:?package=AzureAutoNumber&version=1.1.0

// Install AzureAutoNumber as a Cake Tool
#tool nuget:?package=AzureAutoNumber&version=1.1.0                

High performance, distributed unique thread-safe id generator for Azure.

  • Human-friendly generated ids (number)
  • High performant and fast
  • 100% guarantee that won't cause any duplicate ids

How to use

The project is rely on Azure Blob Storage. AutoNumber package will generate ids by using a single text file on the Azure Blob Storage.

var blobStorageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString);

var blobOptimisticDataStore = new BlobOptimisticDataStore(blobStorageAccount, "unique-ids");

var idGen = new UniqueIdGenerator(blobOptimisticDataStore);

// generate ids with different scopes

var id = idGen.NextId("urls");
var id2 = idGen.NextId("orders");

With Microsoft DI

The project has an extension method to add it and its dependencies to Microsoft ASP.NET DI. The only caveat is you need to registry type of CloudStorageAccount in DI before registring AutoNumber.

// configure the services
serviceCollection.AddAutoNumber();

// Inject `IUniqueIdGenerator` in constructor

public class Foo
{
  public Foo(IUniqueIdGenerator idGenerator)
  {
      _idGenerator = idGenerator;
  }
}

Configuration

These are default configuration for AutoNumber. If you prefer registering AutoNumber with AddAddNumber method, these options can be set via appsettings.json.

{
  "AutoNumber": {
    "BatchSize": 50,
    "MaxWriteAttempts": 25,
    "StorageContainerName": "unique-urls"
  }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AzureAutoNumber:

Package Downloads
ASPOT_API_SharedUtilities

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 616 10/25/2024
1.4.0 104,647 8/25/2022
1.3.3 94,721 3/28/2022
1.3.2 34,684 7/29/2021
1.3.0 38,333 1/8/2021
1.2.2 16,193 8/28/2020
1.2.1 29,717 6/30/2020
1.1.0 751 6/26/2020
1.0.0 39,909 2/17/2020

WindowsAzure.Storage is deprecated, the package is replaced by following packages:

Azure.Storage.Blobs
Microsoft.Azure.Storage.Blob