提交 ad3fc5f3 编写于 作者: 又有人误人子弟了's avatar 又有人误人子弟了

docs: optimize `C#` readme.md

上级 d4b9a26f
......@@ -6,14 +6,19 @@
(支持:.net framework4.6.1+/.net core 2.0+/.net5/.net6+/mono5.4+/Unity 2018+/Xamarin/)
## 引用 nuget 包
```
```xml
<PackageReference Include="Yitter.IdGenerator" Version="1.0.*" />
```
或者使用nuget CLI时
```shell
nuget install Yitter.IdGenerator
```
更多引入方式请点击查看: [nuget.org/packages/Yitter.IdGenerator](https://www.nuget.org/packages/Yitter.IdGenerator)
## 调用示例(C#)
第1步,**全局** 初始化(应用程序启动时执行一次):
```
```cs
// 创建 IdGeneratorOptions 对象,可在构造函数中输入 WorkerId:
var options = new IdGeneratorOptions(Your_Unique_Worker_Id);
// options.WorkerIdBitLength = 10; // 默认值6,限定 WorkerId 最大值为2^6-1,即默认最多支持64个节点。
......@@ -28,7 +33,7 @@ YitIdHelper.SetIdGenerator(options);
```
第2步,生成ID:
```
```cs
// 初始化后,在任何需要生成ID的地方,调用以下方法:
var newId = YitIdHelper.NextId();
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册