示例#1
0
        public async Task HandleAsync(SubmitCode command, KernelInvocationContext context)
        {
            var parseResult = command.KernelNameDirectiveNode.GetDirectiveParseResult();

            var value = command.LanguageNode.Text.Trim();

            var options = ValueDirectiveOptions.Create(parseResult);

            if (options.FromFile is {})
示例#2
0
            protected override async Task Handle(KernelInvocationContext kernelInvocationContext, InvocationContext commandLineInvocationContext)
            {
                var options = ValueDirectiveOptions.Create(commandLineInvocationContext.ParseResult);

                if (options.FromFile is {} fromFile)
                {
                    var value = File.ReadAllText(fromFile.FullName);
                    await _kernel.StoreValueAsync(value, options, kernelInvocationContext);
                }