private void AddRange()
        {
            UnitOfWork[]  workItems = new UnitOfWork[20];
            ActivityLog[] logItems  = new ActivityLog[20];

            for (int i = 0; i < workItems.Length; i++)
            {
                workItems[i] = new UnitOfWork();
                logItems[i]  = new ActivityLog {
                    Id = workItems[i].Id
                };
            }

            Stopwatch sw1 = Stopwatch.StartNew();

            TaskList.AddRange(workItems);
            Activity.AddRange(logItems);
            sw1.Stop();

            for (int i = 0; i < workItems.Length; i++)
            {
                UnitOfWork  task = workItems[i];
                ActivityLog log  = logItems[i];

                log.AddElapsed = sw1.Elapsed;
                Task.Factory.StartNew(task.Run)
                .ContinueWith(t =>
                {
                    Stopwatch sw2     = Stopwatch.StartNew();
                    bool rc           = TaskList.Remove(task);
                    int index2        = TaskList.IndexOf(task);
                    log.RemoveElapsed = sw2.Elapsed;
                    log.Success       = rc && index2 == -1;
                });
            }
        }
        public void AddTask()
        {
            UnitOfWork  task = new UnitOfWork();
            ActivityLog log  = new ActivityLog()
            {
                Id = task.Id
            };

            Stopwatch sw1 = Stopwatch.StartNew();

            TaskList.Add(task);
            Activity.Add(log);
            log.AddElapsed = sw1.Elapsed;

            Task.Factory.StartNew(task.Run, TaskCreationOptions.AttachedToParent)
            .ContinueWith(t =>
            {
                Stopwatch sw2     = Stopwatch.StartNew();
                bool rc           = TaskList.Remove(task);
                int index2        = TaskList.IndexOf(task);
                log.RemoveElapsed = sw2.Elapsed;
                log.Success       = rc && index2 == -1;
            });
        }