mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-04-18 23:22:51 +08:00
<doc>
This commit is contained in:
parent
31e31c5d49
commit
8c1083f732
44
README.md
44
README.md
@ -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}
|
||||
```
|
@ -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}
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user