Esempio n. 1
0
        private void DeleteRelatedDate(Device device)
        {
            var ud = _context.UserDevices.Where(ud => ud.Device.DeviceId == device.DeviceId);

            _context.RemoveRange(ud);
            _context.SaveChanges();
        }
Esempio n. 2
0
        public virtual async Task DeleteManyAsync(IList <TEntity> entities)
        {
            ArgumentGuard.NotNull(entities, nameof(entities));

            _dbContext.RemoveRange(entities);

            await _dbContext.SaveChangesAsync();
        }
 private void DeleteRelatedData(Category category)
 {
     foreach (var device in category.Devices)
     {
         var ud = _context.UserDevices.Where(ud => ud.Device.DeviceId == device.DeviceId);
         _context.RemoveRange(ud);
         _context.SaveChanges();
     }
 }