コード例 #1
0
        private void DeleteRelatedDate(Device device)
        {
            var ud = _context.UserDevices.Where(ud => ud.Device.DeviceId == device.DeviceId);

            _context.RemoveRange(ud);
            _context.SaveChanges();
        }
コード例 #2
0
        public virtual async Task DeleteManyAsync(IList <TEntity> entities)
        {
            ArgumentGuard.NotNull(entities, nameof(entities));

            _dbContext.RemoveRange(entities);

            await _dbContext.SaveChangesAsync();
        }
コード例 #3
0
 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();
     }
 }