AutoMapper.AutoMapperMappingException异常?

那一抹嫣红 2015-01-13 02:47:42
Mapper.DynamicMap<IDataReader, List<T>>(data.CreateDataReader())这出错,但是我用调试测试居然可以用,用wcf调用接口用不了


AutoMapper.AutoMapperMappingException:

Mapping types:
IDataReader -> List`1
System.Data.IDataReader -> System.Collections.Generic.List`1[[HuiShi.Models.GMDBNew.S1MoneyDetail, HuiShi.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

Destination path:
List`1

Source value:
System.Data.DataTableReader ---> System.InvalidProgramException: 公共语言运行时检测到无效的程序。
在 DynamicCreate(IDataRecord )
在 AutoMapper.Mappers.DataReaderMapper.Map(ResolutionContext context, IMappingEngineRunner mapper)
在 AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(ResolutionContext context)
--- 内部异常堆栈跟踪的结尾 ---
在 AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(ResolutionContext context)
在 AutoMapper.MappingEngine.DynamicMap[TSource,TDestination](TSource source)
在 HuiShi.Core.Data.SqlHelper.GetDataPage[T](Database db, String sql, String sort, Int32 start, Int32 limit, Int32& total) 位置 d:\worksapceleon\JianghuyouDspG2\HuiShi.Core\Data\SqlHelper.cs:行号 542
在 Db.GMDBNew.Repositories.S1DHRoleLoveinessRepository.GetS1DHNewMoney(String p1, QueryModel qm, Int32 Pstart, Int32 Plimit, Int32& outTotal) 位置 d:\worksapceleon\JianghuyouDspG2\Db.GMDBNew.Service\Repositories\RepositoryBase.cs:行号 1565
在 Db.GMDBNew.Service.ReportService.GetS1DHNewMoney(PageofList`1 p, QueryModel qm) 位置 d:\worksapceleon\JianghuyouDspG2\Db.GMDBNew.Service\Services\ReportService.cs:行号 1398
在 HuiShi.Services.WCF.GMDBNew.ReportService.GetS1DHNewMoney(PageofList`1 p, QueryModel qm) 位置 d:\worksapceleon\JianghuyouDspG2\HuiShi.Services\WCF\GMDBNew\ReportService.cs:行号 740
在 SyncInvokeGetS1DHNewMoney(Object , Object[] , Object[] )
在 System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
在 System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
在 System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
...全文
171 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧