Setting a custom model for a Razor view while also using a layout and viewstart file causes an error similar to this:
Exception while processing document /ViewStartAndLayout/Test.cshtml in module unknown: The model item passed into the ViewDataDictionary is of type 'System.Int32[]', but this ViewDataDictionary instance requires a model item of type 'Wyam.Common.Documents.IDocument'.
There are two new tests in this PR. There was no test yet for setting the view model from a delegate and the second test covers the error.
The fix I did doesn't seem to break any tests which seems, which makes me wonder why that line was there in the first place.
A bit of background: I'm working on a Wyam module that pulls in content from Kontent headless CMS. The client for that CMS supports strong typed content models which is something I'm also hoping to support with this module for Wyam.
Setting a custom model for a Razor view while also using a layout and viewstart file causes an error similar to this:
There are two new tests in this PR. There was no test yet for setting the view model from a delegate and the second test covers the error.
The fix I did doesn't seem to break any tests which seems, which makes me wonder why that line was there in the first place.
A bit of background: I'm working on a Wyam module that pulls in content from Kontent headless CMS. The client for that CMS supports strong typed content models which is something I'm also hoping to support with this module for Wyam.