In the context of Razor views, which directive would you use in _ViewImports.cshtml to define a shared model type across views?

  • @model
  • @inherits
  • @using
  • @namespace
To define a shared model type across Razor views, you would use the @inherits directive in the _ViewImports.cshtml file. This directive specifies the base class for all views in the directory, allowing you to set a common model type for those views.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *