Hi James,
I am not sure if I fully understood what you want to achieve but let my try to help you.
If you want to flush data and query the data again in another method for your tests, I can think of a scenario where you encapsulate your test scenarios with a System.Transaction that can be Disposed if no data should be written to the database.
See the following scrip as an example:
As you can see I am setting up an OpenAccessContext that is later used in the method that should do the work. The result of this example is, that I am able to query the inserted user from the first call during the second call.
In the end I am disposing the TransactionScope and no data is written to my database.
If you would use individual context objects in your methods wit the using pattern, then you wouldn't be able to see the data that was inserted within another method, because you would operate on another connection to the database.
I hope this answer is useful for you.
Feel free to ask if you have any other question.Regards,
Ralph
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!