整个错误消息:传递到字典的模型产品类型...,但这需要字典...
The model item passed into the dictionary is of type
'MyClass`2[Implementation1,Implementation2]',
but this dictionary requires a model item of type
'MyClass`2[Interface1,Interface2]'.
在我看来,我有模型声明:
@model MyClass<Interface1, Interface2>
凡MyClass的是类和接口1和接口2都在我的控制器操作界面
我打电话:
return View(model);
其中: 模式的类型是...
...和Implementation1实现接口1和Implementation2工具接口2
有什么办法避免这个错误,而不必像下面那样声明我的模型?
@model MyClass<Implementation1, Implementation2>
任何原因,你不能让你的模型使用'MyClass的<接口1,接口2> '? – DavidG 2014-10-09 08:33:55