﻿using Microsoft.Extensions.DependencyInjection;

namespace Preduzece.TimeTracker.Core
{
    public static class FeatureExtensions
    {
        public static IMvcBuilder AddFeaturesToRazorLocations(this IMvcBuilder mvc)
        {
            return mvc.AddRazorOptions(
                o =>
                {
                    o.ViewLocationFormats.Clear();
                    o.ViewLocationFormats.Add("/Features/{3}/{1}/{0}.cshtml");
                    o.ViewLocationFormats.Add("/Features/{3}/{0}.cshtml");
                    o.ViewLocationFormats.Add("/Features/Shared/{0}.cshtml");
                    o.ViewLocationExpanders.Add(new FeatureViewLocationExpander());
                });
        }
    }
}