Example #1
0
        protected virtual async Task RenderOperationsAsync(Stream output, IRequest httpReq, ServiceMetadata metadata)
        {
            var allValidationRules = await httpReq.GetAllValidateRulesAsync().ConfigAwait();

            var defaultPage = new IndexOperationsControl
            {
                Request              = httpReq,
                MetadataConfig       = HostContext.MetadataPagesConfig,
                Title                = HostContext.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
                GetOperation         = operationName => {
                    var opType = HostContext.Metadata.GetOperationType(operationName);
                    var op     = HostContext.Metadata.GetOperation(opType).ApplyValidationRules(allValidationRules);
                    return(op);
                }
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            metadataFeature?.IndexPageFilter?.Invoke(defaultPage);

            await defaultPage.RenderAsync(output).ConfigAwait();
        }
Example #2
0
        protected virtual Task RenderOperationsAsync(Stream output, IRequest httpReq, ServiceMetadata metadata)
        {
            var defaultPage = new IndexOperationsControl
            {
                Request              = httpReq,
                MetadataConfig       = HostContext.MetadataPagesConfig,
                Title                = HostContext.ServiceName,
                Xsds                 = XsdTypes.Xsds,
                XsdServiceTypesIndex = 1,
                OperationNames       = metadata.GetOperationNamesForMetadata(httpReq),
            };

            var metadataFeature = HostContext.GetPlugin <MetadataFeature>();

            metadataFeature?.IndexPageFilter?.Invoke(defaultPage);

            return(defaultPage.RenderAsync(output));
        }