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

Consider to remove inheriting from a base class for pages (cshtml files) #4175

Closed
hikalkan opened this issue Jun 2, 2020 · 2 comments · Fixed by #4247
Closed

Consider to remove inheriting from a base class for pages (cshtml files) #4175

hikalkan opened this issue Jun 2, 2020 · 2 comments · Fixed by #4247
Assignees
Milestone

Comments

@hikalkan
Copy link
Member

hikalkan commented Jun 2, 2020

While it works on runtime, it doesn't play well with the IDE (tested on Visual Studio & Rider):

image

We should find a solution to this problem (since it makes harder to use intellisense in views) or remove inheritance and add @Inject directives for the inherited properties when needed.

We had used this style of inheritance on some module and template pages (I am not sure about templates).

@maliming
Copy link
Member

maliming commented Jun 2, 2020

@hikalkan
We can’t use @model and @inherits on the same page. We can have @inherits in a _ViewImports.cshtml file that the Razor page imports.

image

@hikalkan
Copy link
Member Author

hikalkan commented Jun 7, 2020

@maliming we can remove all inheritances for razor pages, it has no much benefit.

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

Successfully merging a pull request may close this issue.

2 participants