Row not found exception

1 posts, 0 answers
  1. Squall
    Squall avatar
    3 posts
    Member since:
    Aug 2013

    Posted 27 Dec 2015 Link to this post

    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();
                    }
                });

Back to Top