Snippets

OICP 2.1 Get Charge Detail Record | C#

You are viewing an old version of this snippet. View the current version.
Revised by Gregor Schermuly 80ebc3a
/// <summary>
/// Create a new task querying charge detail records from the OICP server.
/// </summary>
/// <param name="ProviderId">The unique identification of the EVSP.</param></param>
/// <param name="From">The starting time.</param></param>
/// <param name="To">The end time.</param></param>
/// <param name="QueryTimeout">An optional timeout for this query.</param></param>
public async Task<HTTPResponse<IEnumerable<eRoamingChargeDetailRecord>>>

    GetChargeDetailRecords(EVSP_Id     ProviderId,
                           DateTime    From,
                           DateTime    To,
                           TimeSpan?   QueryTimeout  = null)

{
    [...]
}
var HubjectEMP = new EMPClient("api.playground.hubject.com");

Task.Factory.StartNew(async () => {

    var result = await HubjectEMP.
        GetChargeDetailRecords(EVSP_Id.Parse("DE*GDF"),
                               new DateTime(2015, 10,  1),
                               new DateTime(2015, 10, 31));

    Console.WriteLine(result.Content.Count() + " charge detail records found!");

}); 
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.