14 lines
423 B
C#
14 lines
423 B
C#
using System.Collections;
|
|
using System.Data.Common;
|
|
|
|
namespace SharpChat.Data;
|
|
|
|
public class DbObjectEnumerable<T>(DbDataReader reader, Func<DbDataReader, T> constructor, Action? dispose = null) : IEnumerable<T> {
|
|
public IEnumerator<T> GetEnumerator() {
|
|
return new DbObjectEnumerator<T>(reader, constructor, dispose);
|
|
}
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() {
|
|
return GetEnumerator();
|
|
}
|
|
}
|