This may be pretty elementary, but can someone give me an overview of the nuts and bolts of how the SafeDataReader works?
I don't understand how it can be used to populate several different objects at a time.
For instance, using the example from the book, where the SafeDataReader is populated by data retrieved from a stored procedure which executes two separate select statements, how does the business object differentiate between the records from the first statement and the second statement when instantiating?
What I do in the book is standard DataReader behavior - it is not at all unique to SafeDataReader. If you look at how SafeDataReader is implemented in Chapter 5, you'll see that it is just a thin wrapper over any System.Data.IDataReader.
The NextResult() method on a datareader moves from the current result set to the next result set.
If you check out the CslaContrib project, you can find an extension of SafeDataReader (called SmartSafeDataReader) that handles additional classes (SmartInt16, SmartInt32, SmartInt64, SmartFloat, SmartBool, etc.). Plus those extra classes.
Copyright (c) Marimer LLC