private void DeleteRelatedDate(Device device) { var ud = _context.UserDevices.Where(ud => ud.Device.DeviceId == device.DeviceId); _context.RemoveRange(ud); _context.SaveChanges(); }
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(); } }