using System;
namespace Umbraco.Web.Website.Routing
{
///
/// The result from querying a controller/action in the existing routes
///
public class ControllerActionSearchResult
{
///
/// Initializes a new instance of the class.
///
private ControllerActionSearchResult(
bool success,
string controllerName,
Type controllerType,
string actionName)
{
Success = success;
ControllerName = controllerName;
ControllerType = controllerType;
ActionName = actionName;
}
///
/// Initializes a new instance of the class.
///
public ControllerActionSearchResult(
string controllerName,
Type controllerType,
string actionName)
: this(true, controllerName, controllerType, actionName)
{
}
///
/// Gets a value indicating whether the route could be hijacked
///
public bool Success { get; }
///
/// Gets the Controller name
///
public string ControllerName { get; }
///
/// Gets the Controller type
///
public Type ControllerType { get; }
///
/// Gets the Acton name
///
public string ActionName { get; }
///
/// Returns a failed result
///
public static ControllerActionSearchResult Failed() => new ControllerActionSearchResult(false, null, null, null);
}
}