This commit is contained in:
nsnail 2022-12-15 16:03:02 +08:00
parent 31e31c5d49
commit 8c1083f732
2 changed files with 86 additions and 2 deletions

View File

@ -1,4 +1,5 @@
# ns-ext
[](README.zh-CN.md) | **En**
The **ns-ext** is a .NET extension function library, containing the following types of extension modules:
@ -20,4 +21,45 @@ The **ns-ext** is a .NET extension function library, containing the following ty
| Stream type extension | StreamExtensions.cs |
| String type extension | StringExtensions.cs |
| Prototype type extension | TypeExtensions.cs |
| Resource locator type extension | UriExtensions.cs |
| Resource locator type extension | UriExtensions.cs |
## Quick start
### Install
```shell
dotnet add package NSExt --prerelease
```
### Example
```c#
using NSExt.Extensions;
internal static class Program
{
private class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
public static void Main(string[] args)
{
var person =
"""
{
"Name": "Jason",
"Age": "30"
}
""".Object<Person>();
Console.WriteLine(person.Json());
}
}
```
### Output
```json
{"name":"Jason","age":30}
```

View File

@ -1,4 +1,5 @@
# ns-ext
[En](README.md) | **中**
**ns-ext** 是一个.NET扩展函数库包含以下类型扩展模块
@ -20,4 +21,45 @@
| 流类型扩展 | StreamExtensions.cs |
| 字符串类型扩展 | StringExtensions.cs |
| 原型类型扩展 | TypeExtensions.cs |
| 资源定位符类型扩展 | UriExtensions.cs |
| 资源定位符类型扩展 | UriExtensions.cs |
## 快速开始
### 安装
```shell
dotnet add package NSExt --prerelease
```
### 示例
```c#
using NSExt.Extensions;
internal static class Program
{
private class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
public static void Main(string[] args)
{
var person =
"""
{
"Name": "Jason",
"Age": "30"
}
""".Object<Person>();
Console.WriteLine(person.Json());
}
}
```
### 输出
```json
{"name":"Jason","age":30}
```