AutoMapper.AutoMapperMappingException异常?

问题描述

Mapper.DynamicMap<IDataReader,List<T>>(data.CreateDataReader())这出错,但是我用调试测试居然可以用,用wcf调用接口用不了AutoMapper.AutoMapperMappingException:Mappingtypes:IDataReader->List`1System.Data.IDataReader->System.Collections.Generic.List`1[[HuiShi.Models.GMDBNew.S1MoneyDetail,HuiShi.Models,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null]]Destinationpath:List`1Sourcevalue:System.Data.DataTableReader--->System.InvalidProgramException:公共语言运行时检测到无效的程序。在DynamicCreate(IDataRecord)在AutoMapper.Mappers.DataReaderMapper.Map(ResolutionContextcontext,IMappingEngineRunnermapper)在AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(ResolutionContextcontext)---内部异常堆栈跟踪的结尾---在AutoMapper.MappingEngine.AutoMapper.IMappingEngineRunner.Map(ResolutionContextcontext)在AutoMapper.MappingEngine.DynamicMap[TSource,TDestination](TSourcesource)在HuiShi.Core.Data.SqlHelper.GetDataPage[T](Databasedb,Stringsql,Stringsort,Int32start,Int32limit,Int32&total)位置d:worksapceleonJianghuyouDspG2HuiShi.CoreDataSqlHelper.cs:行号542在Db.GMDBNew.Repositories.S1DHRoleLoveinessRepository.GetS1DHNewMoney(Stringp1,QueryModelqm,Int32Pstart,Int32Plimit,Int32&outTotal)位置d:worksapceleonJianghuyouDspG2Db.GMDBNew.ServiceRepositoriesRepositoryBase.cs:行号1565在Db.GMDBNew.Service.ReportService.GetS1DHNewMoney(PageofList`1p,QueryModelqm)位置d:worksapceleonJianghuyouDspG2Db.GMDBNew.ServiceServicesReportService.cs:行号1398在HuiShi.Services.WCF.GMDBNew.ReportService.GetS1DHNewMoney(PageofList`1p,QueryModelqm)位置d:worksapceleonJianghuyouDspG2HuiShi.ServicesWCFGMDBNewReportService.cs:行号740在SyncInvokeGetS1DHNewMoney(Object,Object[],Object[])在System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Objectinstance,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(BooleanisOperationContextSet)

时间: 2024-08-31 04:29:02

AutoMapper.AutoMapperMappingException异常?的相关文章

AutoMapper匹配复杂类型

问题描述 例:第一个entityclasstemp{publicpeopleone;publicDatetime;voidone();} classpeople{publicPeopleTypetype;publicstringName;voidtwo();} classPeopleType{publicNumbernum;publicstringName;voidthree();} 第二个entityModelclasstempModel{publicpeopleone;publicDatet

AutoMapper用法

AutoMapper是对象到对象的映射工具.在完成映射规则之后,AutoMapper可以将源对象转换为目标对象. 作者:齐飞 原文:http://www.qeefee.com/article/automapper 配置AutoMapper映射规则 AutoMapper是基于约定的,因此在实用映射之前,我们需要先进行映射规则的配置. public class Source { public int SomeValue { get; set; } public string AnotherValue

一文为你详细讲解对象映射库【AutoMapper】所支持场景

前言 在AutoMapper未出世前,对象与对象之间的映射,我们只能通过手动为每个属性一一赋值,时间长了不仅是我们而且老外也觉得映射代码很无聊啊.这个时候老外的所写的强大映射库AutoMapper横空出世,AutoMapper是一个对象映射库, 它提供简单的类型配置,以及简单的映射测试.对象映射通过将一种类型的输入对象转换为不同类型的输出对象而起作用.项目之前有用过,但是对其了解不够透彻映射时有时候会抛异常,后来弃之,本节我们来详细了解下AutoMapper映射库. AutoMapper基础版

process-Widget启动报异常。请求解决

问题描述 Widget启动报异常.请求解决 Unable to launch app or broadcast Intent process is bad act=android.appwidget.action.APPWIDGET_ENABLED 怎么回事啊!!! 开始还好好的,后来不晓得怎么了,装widget一直报这个错,不晓得抽什么风, 网上说神马卸掉重装,卸掉关机重启重装,统统都不行.... 解决方案 http://stackoverflow.com/questions/3253676/

处理The content of the adapter has changed but ListView did not receive a notification异常

istView在更新时报异常: ERROR/AndroidRuntime(15260): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only

ef 通过DbCommandInterceptor 修改数据库连接 添加数据异常

问题描述 ef 通过DbCommandInterceptor 修改数据库连接 添加数据异常 我想实现数据库的读写分离 ef6里面加了DbCommandInterceptor的功能可是修改以后 在添加新数据的时候 抛出异常 "基础提供程序在 Commit 上失败 值不能为 null. 参数名: connection"但是数据已经成功添加那位前辈读到过这个问题呢 请指导 public class EntityCommandInterceptor: DbCommandInterceptor

tomcat启动的问题,报异常

问题描述 tomcat启动的问题,报异常 解决方案 和tomcat没关系.是你web.xml中的配置的servlet加载的时候报错了 解决方案二: 采用flex+struts+spring+hibernate框架,启动tomcat出现异常,寻求解决方法中..... 严重: StandardWrapper.Throwablejava.lang.NullPointerException?at flex.management.BaseControl.getObjectName(BaseControl.

tomcat启动报错-eclipse 启动 tomcat 异常

问题描述 eclipse 启动 tomcat 异常 tomcat: apache-tomcat-7.0.54-windows-x86 绿色版 eclipse: eclipse-jee-luna-R-win32 . eclipse-jee-indigo-SR2-win32 直接在 ${TOMCAT_HOME}/bin 下双击 startup.bat 可以正常启动,无任何问题, 但是在 eclipse 中配置好之后,加入web工程,启动tomcat,就出现了下面的错误信息: Error occurr

myeclipse配置了weblogic,启动服务报异常

问题描述 myeclipse配置了weblogic,启动服务报异常 1C 解决方案 认证没有通过,估计是myeclipse配置weblogic,忘了设置 解决方案二: weblogic用户名密码不对~