Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Razor custom view model breaks with Layout #12

Open
savornicesei opened this issue Jun 3, 2021 · 0 comments
Open

Razor custom view model breaks with Layout #12

savornicesei opened this issue Jun 3, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@savornicesei
Copy link
Contributor

Issue by alanta
Sunday May 24, 2020 at 20:05 GMT
Originally opened as Wyamio/Wyam#12


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.


alanta included the following code: https://github.com/Wyamio/Wyam/pull/12/commits

@savornicesei savornicesei added the bug Something isn't working label Jun 20, 2021
@savornicesei savornicesei added this to the v3.0.0 milestone Jun 24, 2021
@savornicesei savornicesei removed this from the v3.0.0 milestone Jul 17, 2021
@savornicesei savornicesei added this to the v3.0.0 milestone Jul 17, 2021
@savornicesei savornicesei removed this from the v3.0.0 milestone Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant