mirror of
				https://github.com/nsnail/ns-ext.git
				synced 2025-10-31 16:45:28 +08:00 
			
		
		
		
	
			
				
					
						
					
					0e8319771eca72899d323875c761b6c317d3c622
				
			
			
		
	ns-ext
中 | En The ns-ext is a .NET extension function library, containing the following types of extension modules:
| Features | File name | 
|---|---|
| Byte type extension | ByteExtensions.cs | 
| Character Type Extensions | CharExtensions.cs | 
| Date Type Extensions | DateTimeExtensions.cs | 
| Database command type extension | DbCommandExtensions.cs | 
| Decimal Number Type extension | DecimalExtensions.cs | 
| Enumable type extension | EnumerableExtensions.cs | 
| Enumeration type extension | EnumExtensions.cs | 
| General type extension | GenericExtensions.cs | 
| Integer type extension | IntExtensions.cs | 
| Json Serialization option type extension | JsonSerializerOptionsExtensions.cs | 
| Log type extension | LoggerExtensions.cs | 
| Long integer extension | LongExtensions.cs | 
| Object type extension | ObjectExtensions.cs | 
| Stream type extension | StreamExtensions.cs | 
| String type extension | StringExtensions.cs | 
| Prototype type extension | TypeExtensions.cs | 
| Resource locator type extension | UriExtensions.cs | 
Quick start
Install
dotnet add package NSExt --prerelease
Example
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
{"name":"Jason","age":30}
					Languages
				
				
								
								
									C#
								
								96.5%
							
						
							
								
								
									PowerShell
								
								3.3%
							
						
							
								
								
									Batchfile
								
								0.2%