Exemple #1
0
    public async Task <decimal> GetStats(int OrderStatus)
    {
        switch (OrderStatus)
        {
        case 1:
            return(await Task.Factory.StartNew(() =>
            {
                return client.GetCancelledTotal();
            }).ConfigureAwait(false));

        case 2:
            return(await Task.Factory.StartNew(() =>
            {
                return client.GetCompleteTotal();
            }).ConfigureAwait(false));

        case 3:
            return(await Task.Factory.StartNew(() =>
            {
                return client.GetPendingTotal();
            }).ConfigureAwait(false));

        default:
            return(-1);
        }
    }