CodeLiturgy.Dashboard/CodeLiturgy.Views/RazorUtils/RouteRecord.cs

34 lines
766 B
C#

namespace CodeLiturgy.Views.Utils
{
public class Url
{
public string Name;
public string Location;
public Url(string name, string location)
{
Name = name;
Location = location;
}
}
public record RouteRecord(string Name, string RouteKey, string Location, string ControllerName, List<RouteRecord> Children, ViewType ViewType = ViewType.Undefined)
{
public List<Url> ChildrenToUrl()
{
return Children.Select(x => x.ToUrl()).ToList();
}
public Url ToUrl()
{
return new Url(Name, Location);
}
public Url ToUrl(string name)
{
return new Url(name, Location);
}
}
}