Esempio n. 1
0
        public static ConfigBody DicToConfigBody(Dictionary <string, object> source)
        {
            ConfigBody result = new ConfigBody();

            if (null != source)
            {
                result.Key   = (string)source.GetOrDefault("data_key", "error");
                result.Type  = (string)source.GetOrDefault("data_type", "error");
                result.Value = (string)source.GetOrDefault("data_value", "Bool");
                result.Des   = (string)source.GetOrDefault("data_des", "error");
            }
            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new ConfigBody model.
 /// </summary>
 public ConfigBodyViewModel(ConfigBody model)
 {
     Model = model ?? new ConfigBody();
 }