问题描述
我在MVC4中关注MVC的MVC 3音乐商店教程并且已经卡住了。一切顺利,直到我进入使用MVCmusicstore-Assets的Sampledata.cs的阶段,并按照教程中的说明在Global.ascx.cs中进行了一些更改。现在,SampleData.cs中出现错误,其中显示:
无法将类型'string'隐式转换为'int',并且Operator'=='无法应用对'int'和'string'类型的操作数
由于我缺乏MVC经验,我无法弄清楚我在哪里犯了一些简单错误或错误在mvc4中执行mvc3项目教程时需要注意的事项。
我期待你的回复。
I am following MVC 3 music store tutorial for MVC in MVC4 and have gotten stuck . Everything went well until I came in the stage where I used the Sampledata.cs from MVCmusicstore-Assets and made some changes in Global.ascx.cs as instructed in the tutorial. Now the error appears in SampleData.cs which says:
"cannot implicitly convert type 'string' to 'int' "and "Operator '==' cannot be applied to operands of type 'int' and 'string'"
With my lack of experience in MVC, I could not figure out where I made some simple and blunder mistake or there is something to be taken care of while doing mvc3 projects tutorial in mvc4.
I look forward for your reply.
推荐答案
这篇关于坚持使用MVC4,同时遵循MVCmusicstore的MVC3教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!