Пример #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var device = await devicesRepository.FindByIdAsync(id);

            devicesRepository.Remove(device);

            await devicesRepository.CommitAsync();

            return(Ok());
        }
Пример #2
0
        public async Task <IEnumerable <Device> > ImportByModelAsync(DeviceImportModel importModel)
        {
            foreach (var device in importModel.Devices)
            {
                await devicesRepository.AddAsync(device);
            }

            await devicesRepository.CommitAsync();

            return(importModel.Devices);
        }