I am currently using a datareader as the source but I want to instead use a dataset.
//datareader
AutoMapper.Mapper.CreateMap<IDataReader, AccountDTO>()
.ForMember(m => m.AccountId, opt => opt.MapFrom (r => r.GetInt32(r.GetOrdinal("AccountId"))))
.ForMember(m => m.ParentAccountId, opt => opt.MapFrom(r => r.GetInt32(r.GetOrdinal("ParentAccountId"))))
.ForMember(m => m.IsInactive, opt => opt.MapFrom(r => r.GetString(r.GetOrdinal("IsInactive"))))
.ForMember(m => m.AccountName, opt => opt.MapFrom(r => r.GetString(r.GetOrdinal("AccountName"))))
//dataset
AutoMapper.Mapper.CreateMap<DataSet, AccountDTO>()
.ForMember(m => m.AccountId, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.AccountId]))
.ForMember(m => m.ParentAccountId, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.ParentAccountId]))
.ForMember(m => m.IsInactive, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.IsInactive]))
.ForMember(m => m.AccountName, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.AccountName]))
.ForMember(m => m.AccountNumber, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.AccountNumber]))
any ideas?