public async Task <PagedResult <GasPump> > StopAllPumps(IEndpointContext context, string StoreNumber)
        {
            var request  = new StopAllPumpsDataRequest(StoreNumber);
            var response = await context.ExecuteAsync <StopAllPumpsDataResponse>(request).ConfigureAwait(false);

            return(new PagedResult <GasPump>(response.Pumps.AsReadOnly()));
        }
        private Response StopAllPumps(StopAllPumpsDataRequest request)
        {
            var pumps = GasPumpsDataService.GasPumpsByStore[request.StoreNumber];

            if (pumps == null)
            {
                throw new DataValidationException(DataValidationErrors.Microsoft_Dynamics_Commerce_Runtime_ObjectNotFound);
            }

            foreach (var pump in pumps)
            {
                pump.State.GasPumpStatus  = GasPumpStatus.Stopped;
                pump.State.LastUpdateTime = DateTimeOffset.UtcNow;
            }

            return(new StopAllPumpsDataResponse(pumps));
        }