GroupDocsGists
10/24/2017 - 1:34 PM

Examples-CSharp-DataLayer-GetSingleCustomerDataJson.cs

// For complete examples and data files, please go to https://github.com/groupdocsassembly/GroupDocs_Assembly_NET
/// <summary>
/// Deserializes the json file, loop over the deserialized data
/// </summary>
/// <returns>Returns deserialized data</returns>
public static BusinessObjects.Customer GetSingleCustomerDataJson()
{
    string rawData = File.ReadAllText(jsonFile);
    BusinessObjects.Customer[] customers = JsonConvert.DeserializeObject<BusinessObjects.Customer[]>(rawData);

    IEnumerator<BusinessObjects.Customer> customer = GetCustomerDataFromJson().GetEnumerator();
    customer.MoveNext();
    return customer.Current;
}