Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was 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

@pranavkm

Description

@pranavkm

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions