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

Render layouts using LayoutViewModel instead of DynamicViewModel #443

Merged
merged 4 commits into from
Mar 26, 2021

Conversation

heemskerkerik
Copy link
Contributor

Fixes #440.

Because DynamicViewModel is ‘too flexible’, it is difficult to provide a fully working ObjectDescriptor for it. Instead, this introduces a new, more limited LayoutViewModel, which intercepts binding expressions for body, but forwards everything else, including iteration, to the main view’s model. DynamicViewModel is left unmodified, since it’s public and it’s unclear whether people actually use it.

source/Handlebars.Test/ViewEngine/ViewEngineTests.cs Outdated Show resolved Hide resolved
source/Handlebars.Test/ViewEngine/ViewEngineTests.cs Outdated Show resolved Hide resolved
source/Handlebars/LayoutViewModel.cs Outdated Show resolved Hide resolved
source/Handlebars/LayoutViewModel.cs Outdated Show resolved Hide resolved
source/Handlebars/LayoutViewModel.cs Outdated Show resolved Hide resolved
source/Handlebars/LayoutViewModel.cs Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Mar 26, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.0% 90.0% Coverage
0.0% 0.0% Duplication

@probot-auto-merge probot-auto-merge bot merged commit 01ad0e6 into Handlebars-Net:master Mar 26, 2021
@oformaniuk oformaniuk added the bug label Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dictionary<string, object> or dynamic model is not supported by layout views
2 participants