public static Guid GetNextSequntialGuid(EntityMappingConstants entity, string key)
{
if (string.IsNullOrEmpty(key))
throw new Exception("Invalid key");
lock (_seqCacheLock)
{
var k = entity.ToString() + "|" + key;
if (!_sequentialIdGeneratorCache.ContainsKey(k))
ResetSequentialGuid(entity, key, Guid.NewGuid());
return _sequentialIdGeneratorCache[k].NewId();
}
}