SequentialGuid 2.2.1

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

// Install SequentialGuid as a Cake Tool
#tool nuget:?package=SequentialGuid&version=2.2.1


Will generate Sequential Guids based on MongoDB's ObjectId specification. Date & time are encoded into the value so you do not need to store them separately in your database

Define an interface to the signature you like

public interface IIdGenerator
    Guid NewId();

Define your implementing class which can be transient since the singleton is implemented by the framework

public class SequentialIdGenerator : IIdGenerator
    public Guid NewId() => SequentialGuidGenerator.Instance.NewGuid();

Wire it up to .NET Core dependency injection in the ConfigureServices method during application startup

public void ConfigureServices(IServiceCollection services)
    `services.AddTransient<IIdGenerator, SequentialIdGenerator>();`

Finally define a base entity for your application which will contain an id and a timestamp as soon as you initialize it. Note I do not advocate setting a default Id getter this way just illustrating it can be done

public abstract class BaseEntity
    public Guid Id { get; set; } = SequentialGuidGenerator.Instance.NewGuid();
    public DateTime? Timestamp => Id.ToDateTime();
    // If you really must have non-UTC time
    public DateTime? LocalTime => Id.ToDateTime()?.ToLocalTime();
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 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.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.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on SequentialGuid:

Package Downloads

Package Description


Provide extension methods to round trip between NodaTime Instant and sequential guid


EntityFrameworkCore UnitOfWork Repositories


Package Description


Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.4 297,704 2/27/2023
4.0.3 48,273 10/25/2022
4.0.2 8,462 10/20/2022
4.0.1 5,006 10/10/2022
4.0.0 3,000 10/5/2022
3.0.1 79,795 2/22/2022
3.0.0 29,774 9/15/2021
2.5.0 248,243 11/18/2020
2.4.2 21,313 7/31/2020
2.4.1 25,163 7/8/2020
2.4.0 175,581 12/13/2017
2.2.1 1,870 10/17/2017
2.2.0 1,895 9/24/2017
1.0.0 4,857 2/17/2014

Moved to .netstandard2.0 so it can be used with .NET Core on Linux & OSX