using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc.Razor; namespace Nop.Plugin.Misc.BillingoInvoicing.Infrastructure { public class ViewLocationExpander : IViewLocationExpander { public void PopulateValues(ViewLocationExpanderContext context) { } public IEnumerable ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable viewLocations) { if (context.AreaName == "Admin") { viewLocations = new[] { $"/Plugins/Nop.Plugin.Misc.BillingoInvoicing/Areas/Admin/Views/{context.ControllerName}/{context.ViewName}.cshtml" }.Concat(viewLocations); } else { viewLocations = new[] { $"/Plugins/Nop.Plugin.Misc.BillingoInvoicing/Views/{context.ControllerName}/{context.ViewName}.cshtml" }.Concat(viewLocations); } return viewLocations; } } }