Пример #1
0
        private async Task DeleteAllChargesAndRelatedItemsAsync(Battery battery)
        {
            var charges = await _chargeService.GetAsync(battery);

            foreach (var charge in charges)
            {
                await _deleteChargeController.DeleteChargeAndAllRelatedItemsAsync(charge);
            }
        }
Пример #2
0
        public async Task <int> GetActiveCountAsync(Battery battery)
        {
            var charges = await _chargeService.GetAsync(battery);

            return(charges.Where(x => x.BatteryId == battery.Id && (x.Completed is null || x.Completed >= DateTime.UtcNow.AddDays(-3))).ToList().Count);
        }