This is a migrated thread and some comments may be shown as answers.

Row not found exception

0 Answers 28 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Squall
Top achievements
Rank 1
Squall asked on 28 Dec 2015, 04:45 AM

Hello, i want to update database with multithreading.

 I what to archive following scenario but it throw Row not found exception.

Parallel.For(0, 100, new ParallelOptions() {MaxDegreeOfParallelism = 16}, i =>
            {
                using (var db = new EntitiesModel())
                {
                    db.Tests.Single(p => p.Id == 1).Count++;
                    db.SaveChanges();
                }
            });

Tags
Development (API, general questions)
Asked by
Squall
Top achievements
Rank 1
Share this question
or