dotMemory Unit
 
Get dotMemory Unit

Create Reusable Queries

Last modified: 10 May 2022

Quite often, test assertions use identical dotMemory Unit queries (say, returning a set of objects selected by some condition). In such a case, you can create a reusable query just once and use it anywhere in the code. The static QueryBuilder class allows you to create queries that return object sets and filter traffic by specific conditions. Such queries can then be passed as a parameter to the ObjectSet.GetObjects or Traffic.Where methods.