I’m using MVC 6 and would like to be able to access a particular namespace globally from all of my Razor views. In MVC 5 this was fairly simple; I’d just add the following code
Add your namespaces to the_ViewImports.cshtml file (it's under the Views folder).
_ViewImports.cshtml
Example file:
@using Microsoft.AspNetCore.Identity @using Jifiti.Registry.Web.Models.AccountViewModels @using Jifiti.Registry.Web.Models.ManageViewModels @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers