Esempio n. 1
0
        public async Task <List <Delivery> > getAllAsync()
        {
            var listModel = new List <Delivery>();
            var models    = await _repository.GetAllAsync();

            foreach (var item in models)
            {
                listModel.Add(_repository.Find(x => x.Id == item.Id, x => x.Assignment, x => x.Documents, x => x.Student));
            }

            return(listModel);
        }
        protected internal override async Task ProcessAsync(object state)
        {
            var count = Interlocked.Increment(ref executionCount);

            var expiredDeliveries = await _deliveryRepository.GetAllAsync(d =>
                                                                          (d.State == DeliveryState.Created || d.State == DeliveryState.Approved) &&
                                                                          d.AccessWindow.EndTime <= DateTime.UtcNow);

            foreach (var expiredDelivery in expiredDeliveries)
            {
                expiredDelivery.Expire();
                _deliveryRepository.Update(expiredDelivery);
            }

            await _unitOfWork.SaveAllAsync();

            Log.Information("DeliveriesTimedHostedService is working. Count: " + count);
        }
        public async Task <List <DeliveryDto> > GetAllAsync()
        {
            var deliveries = await _deliveryRepository.GetAllAsync();

            return(_mapper.Map <List <Delivery>, List <DeliveryDto> >(deliveries));
        }
Esempio n. 4
0
        public async Task <ActionResult> GetAllAsync()
        {
            var orders = await _deliveryRepository.GetAllAsync();

            return(Ok(orders));
        }
        public async Task <IActionResult> GetAllDeliveries()
        {
            var deliveries = await _deliveryRepository.GetAllAsync();

            return(Ok(deliveries));
        }
Esempio n. 6
0
 public async Task <IEnumerable <DeliveryDto> > GetAllAsync()
 {
     return(_mapper.Map <IEnumerable <DeliveryDto> >(await _deliveryRepository.GetAllAsync()));
 }