Generic Queries

.NET 2.0 supports generic containers. You can use the generics with NDO 1.2 and above. Just use the NDOQuery class instead of the Query class:

PersistenceManager pm = new PersistenceManager();
NDOQuery<Empoyee> = new NDOQuery<Employee>(pm, condition, loadHollow);
List<Employee> = q.Execute();

Note that you don’t use the NewQuery function, but create the NDOQuery object with new. To allow the coupling of the objects to the right PersistenceManager, the pm parameter is always required.

NDOQuery works just like Query, with the exception that it returns a generic List<T> objects.