mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-04-19 23:22:50 +08:00
<doc>
This commit is contained in:
parent
31e31c5d49
commit
8c1083f732
42
README.md
42
README.md
@ -1,4 +1,5 @@
|
|||||||
# ns-ext
|
# ns-ext
|
||||||
|
[中](README.zh-CN.md) | **En**
|
||||||
The **ns-ext** is a .NET extension function library, containing the following types of extension modules:
|
The **ns-ext** is a .NET extension function library, containing the following types of extension modules:
|
||||||
|
|
||||||
|
|
||||||
@ -21,3 +22,44 @@ The **ns-ext** is a .NET extension function library, containing the following ty
|
|||||||
| String type extension | StringExtensions.cs |
|
| String type extension | StringExtensions.cs |
|
||||||
| Prototype type extension | TypeExtensions.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
|
# ns-ext
|
||||||
|
[En](README.md) | **中**
|
||||||
**ns-ext** 是一个.NET扩展函数库,包含以下类型扩展模块:
|
**ns-ext** 是一个.NET扩展函数库,包含以下类型扩展模块:
|
||||||
|
|
||||||
|
|
||||||
@ -21,3 +22,44 @@
|
|||||||
| 字符串类型扩展 | StringExtensions.cs |
|
| 字符串类型扩展 | StringExtensions.cs |
|
||||||
| 原型类型扩展 | TypeExtensions.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