DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="1.2.0" />

 UserDataSlot

static class UserDataSlot
using DotNext.Threading; namespace DotNext { internal static class UserDataSlot { private static long counter; internal static long NewId => ref counter.IncrementAndGet(); } }