Exemplo n.º 1
0
        public static void Persist(String key, String value)
        {
            ConfigurationDao dao = new ConfigurationDao();

            Configuration config = dao.FindByKey(key);
            if (config == null)
            {
                config = new Configuration();
                config.Name = key;
            }
            config.Value = value;

            using (Transaction tx = new Transaction())
            {
                dao.Save(config);
                tx.Commit();
            }
        }
Exemplo n.º 2
0
        public static String GetAsString(String key)
        {
            ConfigurationDao dao = new ConfigurationDao();
            Configuration config = dao.FindByKey(key);

            String result = null;
            if (config != null)
                result = config.Value;

            return result;
        }