Browse Source

增加YidHelper快速使用方法

tags/v1.0.0
zhouzj 4 years ago
parent
commit
099db1bb94
2 changed files with 9 additions and 0 deletions
  1. +5
    -0
      README.md
  2. +4
    -0
      src/Yitter.IdGenerator/YidHelper.cs

+ 5
- 0
README.md View File

@@ -185,6 +185,11 @@ var options = new IdGeneratorOptions()
var newId = new YidGenerator(options).NewLong(); var newId = new YidGenerator(options).NewLong();
``` ```


#### 单机快速使用
```
YidHelper.NewId();
```

#### options说明 #### options说明
``` ```
public class IdGeneratorOptions public class IdGeneratorOptions


+ 4
- 0
src/Yitter.IdGenerator/YidHelper.cs View File

@@ -28,6 +28,10 @@ namespace Yitter.IdGenerator
} }
} }
/// <summary>
/// 设置参数,建议程序初始化时执行一次
/// </summary>
/// <param name="options"></param>
public static void SetIdGenerator(IdGeneratorOptions options) public static void SetIdGenerator(IdGeneratorOptions options)
{ {
_IdGenInstance = new YidGenerator(options); _IdGenInstance = new YidGenerator(options);


Loading…
Cancel
Save