public void Configure(string config)
 {
     if (config != null)
     {
         SuplexDalConfig c = FromYaml(config);
         Type   = c.Type;
         Config = c.Config;
     }
 }
Exemplo n.º 2
0
        public SuplexController()
        {
            string configFileName = "Suplex.Security.WebApi.config.yaml";

            object config = Synapse.Services.ExtensibilityUtility.GetExecuteControllerInstance(null, null, null)?.GetCustomAssemblyConfig("Suplex.Security.WebApi");

            if (config != null)
            {
                SuplexDalConfig suplexDalConfig = SuplexDalConfig.FromObject(config);
                _dal = suplexDalConfig.GetDalInstance();
            }
            else if (File.Exists(configFileName))
            {
                string          configYaml      = File.ReadAllText(configFileName);
                SuplexDalConfig suplexDalConfig = SuplexDalConfig.FromYaml(configYaml);
                _dal = suplexDalConfig.GetDalInstance();
            }
        }
 public string ToYaml(SuplexDalConfig config)
 {
     return(YamlHelpers.Serialize(this));
 }