0
私のアプリケーションの停止にリストから変更するとは私にこのエラーメッセージを与える:IEnumerableを
The model item passed into the dictionary is of type
'System.Collections.Generic.List`1[Test.Models.GamesVM]',
but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1
[Test.Models.Runner]'.
マイコントローラー:
return PartialView("PartialViewAllRunners", db.Runners.ToList());
マイビュー:
@Html.Partial("~/Views/Shared/PartialViewAllRunners.cshtml", Model)
両方View
とPartial View
IEnumerable
を持っていますので、何が問題なのですか、何を変更する必要がありますか?
[This SO post](http://stackoverflow.com/questions/27378288/but-this-dictionary-requires-a-model-item-of-type-system-collections-generic-ie)では、回答。 –
メッセージは自明です。 'Runner'(' IEnumerable'と 'List''は関係ありません)のコレクションを期待するビューに' GamesVM'のコレクションを渡します。 –
@StephenMuecke OK、任意のパーシャルビュー私は、同じモデルでなければならないと付け加えます。 –