Use EndpointDataSource to expose list of custom Endpoints, each one representing a Tenant in my system, more specifically that tenants RequestDelegate / middleware pipeline (lazily constructed, asynchronously, upon first execution of the endpoint)
Associate each endpoint with its own RouteTemplate that uses a custom constraint that will only succeed if the current Tenant ID (from HttpContext.Items) matches that endpoints Tenant ID. e.g: '{path:tenant(1)}' for the endpoint for Tenant 1, '{path:tenant(1)}' for the endpoint for Tenant 2 etc.
Keep the logic that runs on every request and works out what the TenantID is, in a middleware component, added at the start of the pipeline. It puts the value in HttpContext.Items. This then means the the Endpoints stuff - which is dependenct on that value should work.