/// <summary />
        public static Guid GetNextSequentialGuid(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());
            }
        }
        /// <summary />
        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;
                }
            }
        }
		/// <summary>
		/// 
		/// </summary>
		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();
			}
		}
		/// <summary>
		/// 
		/// </summary>
		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;
			}

		}