Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Writing a custom View Engine for specifying custom paths

$
0
0

In beta version we could do something like this in the constructor: (Seems in RC final it won't work)

public MyRazorViewEngine(IRazorPageFactory pageFactory,

	        IRazorViewFactory viewFactory,

	        IViewLocationExpanderProvider viewLocationExpanderProvider,

	        IViewLocationCache viewLocationCache)

	        : base(pageFactory,

	              viewFactory,

	              viewLocationExpanderProvider,

	              viewLocationCache)

	    {

	    }

and 1-2 more steps...

The problem with the beta solution is that now in RC version IViewLocationExpanderProvider couldn't been found.

In previous MVC versions I did something like this, after forming NewPartialViewFormats:

        public XViewEngine()
        {
            base.PartialViewLocationFormats = 
                base.PartialViewLocationFormats.Union(NewPartialViewFormats).ToArray();
        }

Is there any solution?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>