From e4a9cb19952c401eb7ef275b16cb3faa24d0d922 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Sun, 13 Jun 2021 04:00:16 +0200 Subject: [PATCH] Update README.md and Copyright years. --- LICENSE.txt | 2 +- README.md | 43 +++++++++++++++++------ VAR.Json.Tests/Properties/AssemblyInfo.cs | 3 +- VAR.Json/Properties/AssemblyInfo.cs | 2 +- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index d800e6c..6a6ef58 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -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 diff --git a/README.md b/README.md index 8b0cab6..a1e9bd6 100644 --- a/README.md +++ b/README.md @@ -5,23 +5,46 @@ ### VAR.Json Add the resulting assembly as reference in your projects, and this line on code: - using VAR.Json; +```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: - - var jsonWriter = new JsonWriter(); - string jsonText = jsonWriter(new List{1, 2, 3, 4}); +```csharp +string jsonText = JsonWriter.WriteObject(new List{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; +``` + ## 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: - VAR.Json\Build.NuGet.cmd +```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 diff --git a/VAR.Json.Tests/Properties/AssemblyInfo.cs b/VAR.Json.Tests/Properties/AssemblyInfo.cs index eff68c7..6137a7b 100644 --- a/VAR.Json.Tests/Properties/AssemblyInfo.cs +++ b/VAR.Json.Tests/Properties/AssemblyInfo.cs @@ -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("")] diff --git a/VAR.Json/Properties/AssemblyInfo.cs b/VAR.Json/Properties/AssemblyInfo.cs index ac45cca..475314b 100644 --- a/VAR.Json/Properties/AssemblyInfo.cs +++ b/VAR.Json/Properties/AssemblyInfo.cs @@ -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)]