Beispiel #1
0
        public Task <Response <GrootboekModel[]> > GetAllAsync(CancellationToken cancellationToken)
        {
            var result = ClientState.ExecuteGetAllAsync <GrootboekModel>(ResourceName, cancellationToken);

            return(result.ContinueWith <Response <GrootboekModel[]> >((firstTaskResult) =>
            {
                if (firstTaskResult.Result.Result?.Count() == 500)
                {
                    var grootboeken = firstTaskResult.Result.Result;
                    bool hasNextPage = true;
                    var skip = 500;
                    while (hasNextPage)
                    {
                        var nextPageResult = GetAsync($"$skip={skip}&$top=500").GetAwaiter().GetResult();
                        if ((int)nextPageResult.HttpStatusCode >= 200 && (int)nextPageResult.HttpStatusCode <= 299)
                        {
                            hasNextPage = nextPageResult.Result.Count() == 500;
                            skip += nextPageResult.Result.Count();
                            grootboeken = grootboeken.Concat(nextPageResult.Result).ToArray();
                        }
                    }

                    return new Response <GrootboekModel[]>()
                    {
                        HttpStatusCode = firstTaskResult.Result.HttpStatusCode,
                        ResponseBody = firstTaskResult.Result.ResponseBody,
                        Result = grootboeken
                    };
                }
                else
                {
                    return firstTaskResult.Result;
                }
            }));
        }
 public Task <Response <RelatieBijlageContentModel[]> > GetAllAsync(Guid parentId, CancellationToken cancellationToken) => ClientState.ExecuteGetAllAsync <RelatieBijlageContentModel>(GetBaseUri(parentId), cancellationToken);
 public Task <Response <InkoopboekingModel[]> > GetAllAsync(Guid parentId)
 {
     return(ClientState.ExecuteGetAllAsync <InkoopboekingModel>($"{RelatieModel.ResourceName}/{parentId}/{InkoopboekingModel.ResourceName}"));
 }
Beispiel #4
0
 public Task <Response <KostenplaatsModel[]> > GetAllAsync(CancellationToken cancellationToken) => ClientState.ExecuteGetAllAsync <KostenplaatsModel>(ResourceName, cancellationToken);
 public Task <Response <ArtikelModel[]> > GetAllAsync(CancellationToken cancellationToken) => ClientState.ExecuteGetAllAsync <ArtikelModel>(ResourceName, cancellationToken);
Beispiel #6
0
 public Task <Response <VerkooporderModel[]> > GetAllAsync(CancellationToken cancellationToken) => ClientState.ExecuteGetAllAsync <VerkooporderModel>(ResourceName, cancellationToken);
Beispiel #7
0
 public Task <Response <VerkoopBoekingBijlageContentModel[]> > GetAllAsync(Guid parentId) => ClientState.ExecuteGetAllAsync <VerkoopBoekingBijlageContentModel>(GetBaseUri(parentId));
 public Task <Response <RelatieModel[]> > GetAllAsync() => ClientState.ExecuteGetAllAsync <RelatieModel>(ResourceName);
 public Task <Response <DagboekModel[]> > GetAllAsync(CancellationToken cancellationToken) => _clientState.ExecuteGetAllAsync <DagboekModel>(ResourceName, cancellationToken);
Beispiel #10
0
 public Task <Response <DagboekModel[]> > GetAllAsync() => _clientState.ExecuteGetAllAsync <DagboekModel>(ResourceName);
 public Task <Response <KostenplaatsModel[]> > GetAllAsync() => ClientState.ExecuteGetAllAsync <KostenplaatsModel>(ResourceName);
Beispiel #12
0
 public Task <Response <VerkoopBoekingBijlageContentModel[]> > GetAllAsync(Guid parentId, CancellationToken cancellationToken) => ClientState.ExecuteGetAllAsync <VerkoopBoekingBijlageContentModel>(GetAllUri(parentId), cancellationToken);
Beispiel #13
0
 public Task <Response <GrootboekModel[]> > GetAllAsync() => ClientState.ExecuteGetAllAsync <GrootboekModel>(ResourceName);