Skip to content

Latest commit

 

History

History
64 lines (51 loc) · 915 Bytes

README.md

File metadata and controls

64 lines (51 loc) · 915 Bytes

About ClintSharp

Provide an abstraction layer to C# to simplify some stuffs.

Install ClintSharp

Open Powershell or a terminal and enter this command:

dotnet add package ClintSharp

String Functions:

var name = "";
Console.WriteLine(name.IsNull()); // true

DateTime Functions:

var date = DateTime.Now;
Console.WriteLine(date.ToTimestamp()); // 1558800650

Json Functions:

The Json methods use Newtonsoft.Json.

var user = new List<User>() {};
...
Console.WriteLine(date.ToJson());
// Result: [{"username":"Clint","age":30},{"username":"John","age":19},{"username":"Jack","age":25}]
var user = new List<User>() {};
...
Console.WriteLine(date.ToJsonF());

Result:

[
  {
    "username": "Clint",
    "age": 30
  },
  {
    "username": "John",
    "age": 19
  },
  {
    "username": "Jack",
    "age": 25
  }
]