This commit is contained in:
2018-12-18 16:33:35 +00:00
parent 077ee889eb
commit 27b77c5273
36 changed files with 10640 additions and 0 deletions

26
AutoId.cs Normal file
View File

@@ -0,0 +1,26 @@
using System;
using System.Threading.Tasks;
namespace raven_integration
{
public class AutoId
{
private readonly object valueLock = new object();
private uint currentValue; //postgre bigint
public AutoId(uint initialValue)
{
currentValue = initialValue;
}
public uint GetNext()
{
lock (valueLock)
{
currentValue += 1;
if (currentValue == 0)
currentValue += 1;
return currentValue;
}
}
}
}