コード例 #1
0
    private static ActionSelectionTable <Endpoint> CreateTableWithEndpoints(IReadOnlyList <ActionDescriptor> actions)
    {
        var endpoints = actions.Select(a =>
        {
            var metadata = new List <object>(a.EndpointMetadata ?? Array.Empty <object>());
            metadata.Add(a);
            return(new Endpoint(
                       requestDelegate: context => Task.CompletedTask,
                       metadata: new EndpointMetadataCollection(metadata),
                       displayName: a.DisplayName));
        });

        return(ActionSelectionTable <ActionDescriptor> .Create(endpoints));
    }
コード例 #2
0
 private static ActionSelectionTable <ActionDescriptor> CreateTableWithActionDescriptors(IReadOnlyList <ActionDescriptor> actions)
 {
     return(ActionSelectionTable <ActionDescriptor> .Create(new ActionDescriptorCollection(actions, 0)));
 }
コード例 #3
0
 private static ActionSelectionTable <Endpoint> Initialize(IReadOnlyList <Endpoint> endpoints)
 {
     return(ActionSelectionTable <Endpoint> .Create(endpoints));
 }