I'm studying the encapsulatedInvoke sample recently released and I've found that child_fecth of PersonInfo uses idatareader instead of SafeDatareader. Shouldn't it be better if the Fetch function of the interface IPersonDal returned a Safedatareader?
The purpose of the sample is to illustrate a very abstract DAL implementation that doesn't rely on any specific type of data reader.
SafeDataReader is a nice tool for removing null values, but it is absolutely not required for any application scenario.
Thank you Mr.Rockford for taking the time for response.
So, How should I use SafeDatareader in this Encapsulated invocation model? I'm migrating my code from Encapsulated implementation to Encapsulated invocation and I would like not losing the funcionality that Safedatareader provides.
I discuss how to use SafeDataReader in the Data Access ebook. It wraps any IDataReader. So in that example, you might do this:
var data = new SafeDataReader(dal.Fetch());
Because the Fetch method returns an IDataReader, the result can be wrapped in a SafeDataReader to eliminate null values.
Copyright (c) Marimer LLC