public static ResetSequentialGuid ( EntityMappingConstants entity, string key, System.Guid seed ) : void | ||
entity | EntityMappingConstants | |
key | string | |
seed | System.Guid | |
Résultat | void |
public static void ResetSequentialGuid(EntityMappingConstants entity, string key, Guid seed)
{
if (string.IsNullOrEmpty(key))
throw new Exception("Invalid key");
lock (_seqCacheLock)
{
var k = entity.ToString() + "|" + key;
if (!_sequentialIdGeneratorCache.ContainsKey(k))
_sequentialIdGeneratorCache.Add(k, new SequentialIdGenerator(seed));
else
_sequentialIdGeneratorCache[k].LastValue = seed;
}
}