Exemplo n.º 1
0
        private static string ModifyPropertyType(PropertyTemplate prop)
        {
            var          type    = prop.PropType;
            const string pattern = "List\\<(\\w+)\\>";
            Match        m       = Regex.Match(type, pattern);
            string       newType;

            if (m.Success)
            {
                var name = m.Groups[1].ToString();
                if (!ClassChangedName.ContainsKey(name))
                {
                    return(type);
                }
                newType = $"List<{ClassChangedName[name]}>";
                ModelWarning.Add($"Modify the type of the property: '{prop.ClassName}.{prop.PropName}' from  {type} to {newType}");
                return(newType);
            }

            if (!ClassChangedName.ContainsKey(type))
            {
                return(type);
            }

            newType = ClassChangedName[type];
            ModelWarning.Add($"++ Modify the type of the property: '{prop.ClassName}.{prop.PropName}' from  {type} to {newType}");
            return(newType);
        }
Exemplo n.º 2
0
 public static void AddItem(string key, string value)
 {
     if (!ClassChangedName.ContainsKey(key))
     {
         ClassChangedName.Add(key, value);
     }
 }