//methods public Task Insert <TEntity>(List <TEntity> entities) where TEntity : class { List <TEntity> newList = new List <TEntity>(); foreach (TEntity item in entities) { bool drop = RandomPicker.NextBoolean(_dropOutChance); if (drop) { continue; } newList.Add(item); } return(_persistentStorage.Insert(newList)); }