using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Razor;

namespace Nop.Web.Areas.Admin.Infrastructure
{
    public class CustomViewEngine : IViewLocationExpander
    {

        public void PopulateValues(ViewLocationExpanderContext context)
        {
        }

        public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
        {
            if (context.AreaName != null)
            {
                viewLocations = new string[] {
                      $"/areas/admin/Views/B2CView/{{1}}/{{0}}.cshtml",
                      $"/areas/admin/Views/Shared/{{0}}.cshtml",
                }.Concat(viewLocations);
                return viewLocations;
            }
            return viewLocations;
        }
        public int Order
        {
            get { return -1001; } //add after nopcommerce is done
        }
    }
}
