Created
December 7, 2016 09:05
-
-
Save ertugrulozcan/5ed51a3a81817b8add8b24e9d3a2ec36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"CompanyList" : [ | |
{ | |
"Name": "Optiim", | |
"Address": "Blablala", | |
"PhoneNumber": "0123456789", | |
}, | |
{ | |
"Name": "Matriks", | |
"Address": "Blablala", | |
"PhoneNumber": "0123456789", | |
}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ornek Company sinifi boyle olsun; | |
public class Company | |
{ | |
public string Name { get; set; } | |
public string Address { get; set; } | |
public string PhoneNumber { get; set; } | |
} | |
// ... | |
// GetCompanyListJson() metodu json string'ini veriyor olsun. | |
string jsonStr = GetCompanyListJson(); | |
// Json'dan listeye boyle donusturulur; | |
List<Company> companyList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Company>>(jsonStr); | |
// Object'den Json uretmek şstersen de; | |
string jsonStr2 = Newtonsoft.Json.JsonConvert.SerializeObject(companyList); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment