Inheritance: Microsoft.CodeAnalysis.MetadataReferenceResolver, IFunctionMetadataResolver
Esempio n. 1
0
 public FunctionAssemblyLoadContext(FunctionMetadata functionMetadata, Assembly functionAssembly, FunctionMetadataResolver resolver)
 {
     _metadataResolver = resolver;
     _loadedAssemblies = ImmutableArray <Assembly> .Empty;
     FunctionAssembly  = functionAssembly;
     Metadata          = functionMetadata;
 }
Esempio n. 2
0
        internal CSharpFunctionInvoker(ScriptHost host, FunctionMetadata functionMetadata,
                                       Collection <FunctionBinding> inputBindings, Collection <FunctionBinding> outputBindings,
                                       IFunctionEntryPointResolver functionEntryPointResolver, FunctionAssemblyLoader assemblyLoader)
            : base(host, functionMetadata)
        {
            _host = host;
            _functionEntryPointResolver = functionEntryPointResolver;
            _assemblyLoader             = assemblyLoader;
            _metadataResolver           = new FunctionMetadataResolver(functionMetadata, TraceWriter);
            _inputBindings    = inputBindings;
            _outputBindings   = outputBindings;
            _triggerInputName = GetTriggerInputName(functionMetadata);
            _metrics          = host.ScriptConfig.HostConfig.GetService <IMetricsLogger>();

            InitializeFileWatcherIfEnabled();
            _resultProcessor = CreateResultProcessor();

            _functionValueLoader = FunctionValueLoader.Create(CreateFunctionTarget);

            _reloadScript = ReloadScript;
            _reloadScript = _reloadScript.Debounce();

            _restorePackages = RestorePackages;
            _restorePackages = _restorePackages.Debounce();
        }
Esempio n. 3
0
        public FunctionAssemblyLoadContext CreateOrUpdateContext(FunctionMetadata metadata, Assembly functionAssembly, FunctionMetadataResolver metadataResolver)
        {
            if (metadata == null)
            {
                throw new ArgumentNullException("metadata");
            }
            if (functionAssembly == null)
            {
                throw new ArgumentNullException("functionAssembly");
            }
            if (metadataResolver == null)
            {
                throw new ArgumentNullException("metadataResolver");
            }

            var context = new FunctionAssemblyLoadContext(metadata, functionAssembly, metadataResolver);

            return(_functionContexts.AddOrUpdate(metadata.Name, context, (s, o) => context));
        }