views:

145

answers:

1

I have a scenario where I want to have a question object and users can concurrently add answer objects to the question object. The question object needs to maintain the answer count.

How can I do an implementation in Linq2Sql that transactionaly saves the answer object that the user submitted to the question and updates the incremented answer count of the question object and also handles any concurrency violations when trying to update the answer count of the question object?

A: 

Update the Answer Count with the count of the number of answer objects attached to the question. Then you won't have to worry about concurrency because it will just count the number of answers that are there (at any given moment).

Robert Harvey