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)); }
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)); }