Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
#nullable enable
namespace Grand.Web.Common.View;
public class ViewFactory : IViewFactory
{
private readonly IDictionary<string, IAreaViewFactory> _areaFactories;
public ViewFactory(IEnumerable<IAreaViewFactory> areaFactories)
{
_areaFactories = areaFactories.ToDictionary(f => f.AreaName, f => f);
}
public void GetViewPath(string areaName, ref IEnumerable<string> viewLocations)
{
if (_areaFactories.TryGetValue(areaName, out var areaFactory))
{
viewLocations = areaFactory.GetViewLocations(viewLocations);
return;
}
viewLocations = new List<string> {
"/Views/{1}/{0}.cshtml",
"/Views/Shared/{0}.cshtml"
};
}
}