using System.Collections.Generic;
using zero.Core.Attributes;
using zero.Core.Entities;
namespace zero.Core.Routing
{
[Collection("Routes")]
public class Route : IRoute
{
///
public string Id { get; set; }
///
public string Url { get; set; }
///
public string ProviderAlias { get; set; }
///
public bool AllowSuffix { get; set; }
///
public Dictionary Params { get; set; } = new Dictionary();
///
public IList References { get; set; } = new List();
///
public IList Dependencies { get; set; } = new List();
}
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;
}
}
[Collection("Routes")]
public interface IRoute : IZeroIdEntity, IZeroDbConventions
{
///
/// Generated URL based on the URL provider
///
string Url { get; set; }
///
/// Alias of the URL provider which generated this route
///
string ProviderAlias { get; set; }
///
/// Enable this property so all routes are catched which start with this Url
///
public bool AllowSuffix { get; set; }
///
/// Additional parameters
///
Dictionary Params { get; set; }
///
/// Contains references to the resolved collection entities
///
IList References { get; set; }
///
/// Route dependencies can be used for cache busting
///
IList Dependencies { get; set; }
}
}