Esempio n. 1
0
    internal static Uri EndpointFromResource(ApiResources resource, params object?[] parameters)
    {
        FieldInfo fieldInfo = typeof(ApiResources).GetField(resource.ToString()) !;
        ResourceRouteAttribute attribute = fieldInfo.GetCustomAttribute <ResourceRouteAttribute>() !;

        return(new Uri(string.Format(attribute.Endpoint, parameters), UriKind.Relative));
    }
Esempio n. 2
0
    internal static Uri EndpointFromResource(ApiResources resource)
    {
        FieldInfo fieldInfo = typeof(ApiResources).GetField(resource.ToString()) !;
        ResourceRouteAttribute attribute = fieldInfo.GetCustomAttribute <ResourceRouteAttribute>() !;

        return(new Uri(attribute.Endpoint, UriKind.Relative));
    }