forbid calling NextId method first
This commit is contained in:
@@ -34,7 +34,6 @@ namespace Yitter.IdGenerator
|
||||
/// <summary>
|
||||
/// 生成新的Id
|
||||
/// 调用本方法前,请确保调用了 SetIdGenerator 方法做初始化。
|
||||
/// 否则将会初始化一个WorkerId为1的对象。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static long NextId()
|
||||
@@ -52,6 +51,8 @@ namespace Yitter.IdGenerator
|
||||
// }
|
||||
//}
|
||||
|
||||
if (_IdGenInstance == null) throw new ApplicationException("Please initialize Yitter.IdGeneratorOptions first.");
|
||||
|
||||
return _IdGenInstance.NewLong();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user