Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

RouteProvider.cs

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Nop.Web.Framework.Mvc.Routing;
using Nop.Web.Framework;

namespace Nop.Plugin.Misc.Omnisend.Infrastructure;

/// 
/// Represents plugin route provider
/// 
public class RouteProvider : IRouteProvider
{
    /// 
    /// Register routes
    /// 
    /// Route builder
    public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
    {
        endpointRouteBuilder.MapControllerRoute(name: OmnisendDefaults.ConfigurationRouteName,
            pattern: "Admin/Omnisend/Configure",
            defaults: new { controller = "OmnisendAdmin", action = "Configure", area = AreaNames.ADMIN });

        endpointRouteBuilder.MapControllerRoute(name: OmnisendDefaults.AbandonedCheckoutRouteName,
            pattern: "Omnisend/AbandonedCheckout/{cartId}",
            defaults: new { controller = "Omnisend", action = "AbandonedCheckout" });
    }

    /// 
    /// Gets a priority of route provider
    /// 
    public int Priority => 0;
}