Update README.md and Copyright years.

This commit is contained in:
2021-06-13 04:00:16 +02:00
parent 4cec1c6a20
commit e4a9cb1995
4 changed files with 36 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016-2020 Valeriano Alfonso Rodriguez
Copyright (c) 2016-2021 Valeriano Alfonso Rodriguez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -5,23 +5,46 @@
### VAR.Json
Add the resulting assembly as reference in your projects, and this line on code:
```csharp
using VAR.Json;
```
Parse any string with JSON content:
var jsonParser = new JsonParser();
object result = jsonParser("{\"Test\": 1}");
```csharp
object result = JsonParser.ParseText("{\"Test\": 1}");
```
Serialize any object to JSON:
```csharp
string jsonText = JsonWriter.WriteObject(new List<int>{1, 2, 3, 4});
```
### VAR.Json.JsonParser
This object can be invoked with a list of types used to cast the json objects.
```csharp
class Person
{
public string Name { get; set; }
public string Surname { get; set; }
public DateTime DateOfBirth { get; set; }
}
JsonParser jsonParser = new JsonParser();
jsonParser.KnownTypes.Add(typeof(Person));
Person jsonText = jsonParser.Parse("{ \"Name\": \"John", \"Surname\": \"Doe\", \"DateOfBirth\": \"1970-01-01\"}") as Person;
```
var jsonWriter = new JsonWriter();
string jsonText = jsonWriter(new List<int>{1, 2, 3, 4});
## Building
A Visual Studio 2015 solutions are provided. Simply, click build on the IDE.
A Visual Studio solution is provided. Simply, click build on the IDE.
A .nuget package can be build using:
```cmd
VAR.Json\Build.NuGet.cmd
```
## Contributing
1. Fork it!
@@ -37,7 +60,7 @@ A .nuget package can be build using:
The MIT License (MIT)
Copyright (c) 2016-2017 Valeriano Alfonso Rodriguez
Copyright (c) 2016-2021 Valeriano Alfonso Rodriguez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@@ -10,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VAR.Json.Tests")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © VAR 2016-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("VAR")]
[assembly: AssemblyProduct("VAR.Json")]
[assembly: AssemblyCopyright("Copyright © VAR 2016-2017")]
[assembly: AssemblyCopyright("Copyright © VAR 2016-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]