Ejemplo n.º 1
0
 private static void SetDefaultIfProvidedAndNothingSetYet(IYamlSourceController yamlSourceController, string yaml, YamlType type)
 {
     if (yaml != null)
     {
         try
         {
             yamlSourceController.GetYaml(type);
         }
         catch
         {
             yamlSourceController.SetYaml(type, yaml);
         }
     }
 }
        public void Initialize(string routerYaml = null)
        {
            if (routerYaml == null)
            {
                try
                {
                    routerYaml = _yamlSourceController.GetYaml(YamlType.Routing);
                }
                catch
                {
                }
            }
            if (routerYaml != null)
            {
                //convert http to yaml
                routerYaml = YamlParser.ParseHelper(routerYaml);

                var deserializer = new DeserializerBuilder().Build();
                routingConfiguration = deserializer.Deserialize <RoutingConfiguration>(routerYaml);
            }
            routingConfigurationSet = true;
        }