https://github.com/vqcomms/scriptcs.json
https://github.com/vqcomms/scriptcs.json
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vqcomms/scriptcs.json
- Owner: VQComms
- License: mit
- Created: 2015-05-05T11:35:25.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-05T11:36:59.000Z (about 11 years ago)
- Last Synced: 2025-01-02T07:53:24.914Z (over 1 year ago)
- Language: C#
- Size: 93.8 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScriptCs.Json [](https://www.nuget.org/packages/ScriptCs.Json/)
This is a cross platform ScriptCs library that allows you deserialize JSON into objects.
## Usage
`scriptcs -install ScriptCs.Json`
```
public class Person
{
public string FirstName{ get; set; }
public string LastName{ get; set; }
public string FullName{ get { return FirstName + " " + LastName; } }
}
var myjson = "{\"firstname\":\"bob\",\"lastname\":\"smith\"}";
var json = new Json();
var person = json.Deserialize(myjson);
Console.WriteLine(person.FullName);
var otherPerson = json.DeserializeFromFile("json.txt");
Console.WriteLine(otherPerson.FullName);
Console.WriteLine("Fin!");
```