Files
mixtape/zero.Core/Routing/Route.cs
T

57 lines
1.3 KiB
C#
Raw Normal View History

2020-11-14 12:34:26 +01:00
using System.Collections.Generic;
2020-10-12 12:00:30 +02:00
using zero.Core.Attributes;
using zero.Core.Entities;
namespace zero.Core.Routing
{
[Collection("Routes")]
2021-05-04 17:23:52 +02:00
public class Route : ZeroIdEntity
2020-10-12 12:00:30 +02:00
{
2021-05-04 17:23:52 +02:00
/// <summary>
/// Generated URL based on the URL provider
/// </summary>
2020-10-12 12:00:30 +02:00
public string Url { get; set; }
2021-05-04 17:23:52 +02:00
/// <summary>
/// Alias of the URL provider which generated this route
/// </summary>
2020-10-21 14:11:58 +02:00
public string ProviderAlias { get; set; }
2021-05-04 17:23:52 +02:00
/// <summary>
/// Enable this property so all routes are catched which start with this Url
/// </summary>
2020-10-21 14:11:58 +02:00
public bool AllowSuffix { get; set; }
2021-05-04 17:23:52 +02:00
/// <summary>
/// Additional parameters
/// </summary>
public Dictionary<string, object> Params { get; set; } = new();
2020-10-12 12:00:30 +02:00
2021-05-04 17:23:52 +02:00
/// <summary>
/// Contains references to the resolved collection entities
/// </summary>
public List<RouteReference> References { get; set; } = new();
2020-10-21 14:11:58 +02:00
2021-05-04 17:23:52 +02:00
/// <summary>
/// Route dependencies can be used for cache busting
/// </summary>
public List<string> Dependencies { get; set; } = new();
2020-10-12 12:00:30 +02:00
}
public class RouteReference
{
public string Id { get; set; }
public string Collection { get; set; }
public RouteReference() { }
public RouteReference(string id, string collection)
{
Id = id;
Collection = collection;
}
}
}