I noticed in the Enterprise Library 5.0 code that the Execute method for the CommandAccessor does not use a using statement.
The ExcecuteReader method says the caller should close the reader. I am concerned that if I use the CommandAccessor that I will end up with memory issues.
Do you think my concerns are valid?
/// Executes the <paramref name="command"/> and returns an enumerable of <typeparamref name="TResult"/>.
/// The enumerable returned by this method uses deferred loading to return the results.
/// <param name="command">The command that will be executed.</param>
/// <returns>An enumerable of <typeparamref name="TResult"/>.</returns>
protected IEnumerable<TResult> Execute(DbCommand command)
IDataReader reader = database.ExecuteReader(command);
foreach (TResult result in resultSetMapper.MapSet(reader))
yield return result;