wcf mvc实体框架 [英] wcf mvc entity framework

查看:102
本文介绍了wcf mvc实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:没有任何线索,因为我是MVC和WCF的新手.快速帮助会帮助我,谢谢!!


传递到字典中的模型项的类型为
" MvcMovie.ServiceReference1.Movie []",但此字典需要模型项
类型为"MvcMovie.Models.Movie []"的

I am getting this error: no clue as i am new to MVC and WCF. Fast help would help me thanks!!


The model item passed into the dictionary is of type
''MvcMovie.ServiceReference1.Movie[]'', but this dictionary requires a model item
of type ''MvcMovie.Models.Movie[]''

推荐答案

,这意味着您的实体类已损坏.通常,该错误意味着您将类中的字符串映射到DB中的int(例如).这次,似乎在映射相关类型时遇到了麻烦.是否自动生成带有错误的类?如果不是,您可以更改定义以使其匹配吗?

我记得该错误是向后读取的,因此您会发现自己具有所需的类型,但需要将其更改为其他类型,以匹配数据库
It means your entity classes are broken. Typically the error means that you map a string in a class to an int in the DB ( for example ). This time, it looks like it''s having trouble mapping a related type. Is the class with the error auto generated ? If not, can you change the definition to match ?

It''s my recollection that the error reads backwards, so you will find you have the type it requires, but need to change it to the other type, to match the DB


更改了模型绑定,并重新配置了wcf服务.它的工作!!!!
Changed the model binding and re-configured the wcf service. Its working !!


这篇关于wcf mvc实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆