Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Specifying @model in a page ignores value specified by @inherit from a _ViewImport #3144

Closed
pranavkm opened this issue Sep 16, 2015 · 1 comment
Assignees
Milestone

Comments

@pranavkm
Copy link
Contributor

We have code that prevents @model and @inherits from being specified in the same page. However this check happens at parse time. Consequently specifying an @inherits MyBase<TModel> in _ViewImports and @model CustomModel doesn't produce an error. Instead, the @model wins and resets the base type to the default (RazorPage<>).

This seems like a reasonable thing to do - we shouldn't error on it.

Related: #3143

@danroth27
Copy link
Member

Please chat with @Eilon on the approach for this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants