/// <summary> /// Get the signature of the endpoint, for equality/grouping purposes /// </summary> /// <param name="caller"></param> /// <returns></returns> public string GetSignature(HttpController caller) { return($"{ToString(caller)}(${string.Join(", ", GetParameters().Select(x => x.ToString()))}"); }
/// <summary> /// Returns a string that represents the current object under the context of the caller /// </summary> /// <param name="caller"></param> /// <returns></returns> public string ToString(HttpController caller) { string namespaceVersion = $@"{(caller.NamespaceVersion != null ? $"{caller.NamespaceVersion}." : "")}{(caller.NamespaceSuffix != null ? $"{caller.NamespaceSuffix}." : string.Empty)}"; return($"{namespaceVersion}{caller.Name}.{Name}"); }
/// <summary> /// Full route template for the endpoint /// </summary> public string GetFullRoute(HttpController caller) { return(caller.Route.Merge(Route).Value); }
/// <summary> /// Get all route constraints associated with the endpoint, with the caller being accounted for /// </summary> /// <param name="caller"></param> /// <returns></returns> public IEnumerable <RouteConstraint> GetRouteConstraints(HttpController caller) { return(caller.Route.Merge(Route).Constraints); }
/// <summary> /// Creates an endpoint assosicated with the controller /// </summary> /// <param name="parent"></param> public HttpEndpoint(HttpController parent) { Parent = parent; }