I mean like you retrieve the first 20 rows from the DB during code generation and then either serialize that data or just insert the raw data into a stub class which can then be used from unit tests without touching the DB.
ie if you have an OrderEntity then you could have a class called OrderEntityTestStub which has a method like OrderEntityTestStub.GetTestCollection() that retrieves a pre-populated collection of entities. (at run time, not design time)
Mainly the only thing I need to know how to do is how to access the DB during the code generation process, or if that is possible at all.