Exemple #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));
    }
Exemple #2
0
 private static ActionSelectionTable <ActionDescriptor> CreateTableWithActionDescriptors(IReadOnlyList <ActionDescriptor> actions)
 {
     return(ActionSelectionTable <ActionDescriptor> .Create(new ActionDescriptorCollection(actions, 0)));
 }
Exemple #3
0
 private static ActionSelectionTable <Endpoint> Initialize(IReadOnlyList <Endpoint> endpoints)
 {
     return(ActionSelectionTable <Endpoint> .Create(endpoints));
 }