0
|
1 using BLToolkit.Reflection;
|
|
2
|
|
3 namespace BLToolkit.Mapping
|
|
4 {
|
|
5 public class DataReaderListMapper : IMapDataSourceList
|
|
6 {
|
|
7 public DataReaderListMapper(DataReaderMapper mapper)
|
|
8 {
|
|
9 _mapper = mapper;
|
|
10 }
|
|
11
|
|
12 private readonly DataReaderMapper _mapper;
|
|
13
|
|
14 public virtual void InitMapping(InitContext initContext)
|
|
15 {
|
|
16 initContext.DataSource = _mapper;
|
|
17 initContext.SourceObject = _mapper.DataReader;
|
|
18 }
|
|
19
|
|
20 public virtual bool SetNextDataSource(InitContext initContext)
|
|
21 {
|
|
22 return _mapper.DataReader.Read();
|
|
23 }
|
|
24
|
|
25 public virtual void EndMapping(InitContext initContext)
|
|
26 {
|
|
27 }
|
|
28 }
|
|
29 }
|