public Assembly GetTriggerReference(AbstractFunctionDefinition functionDefinition)
 {
     if (TriggerReferences.TryGetValue(functionDefinition.GetType(), out Assembly assembly))
     {
         return(assembly);
     }
     throw new ConfigurationException($"No trigger reference mapping configured for a function of type {functionDefinition.GetType().Name}");
 }
Ejemplo n.º 2
0
 private string GetTemplate(AbstractFunctionDefinition functionDefinition, string type)
 {
     if (TypeToTemplatePrefixMap.TryGetValue(functionDefinition.GetType(), out string prefix))
     {
         using (Stream stream = GetType().Assembly.GetManifestResourceStream($"FunctionMonkey.Compiler.Templates.{prefix}.{type}.handlebars"))
             using (StreamReader reader = new StreamReader(stream))
                 return(reader.ReadToEnd());
     }
     throw new ConfigurationException($"No templates are configured for function definitions of type {functionDefinition.GetType().Name}");
 }