Ejemplo n.º 1
0
        /// <summary>
        /// Fixes tablenames that will be used as class names to make sure
        /// they are valid classnames.
        /// </summary>
        /// <param name="tableName">The table name to fix.</param>
        /// <param name="isEntitySet">Should this be rendered as an EntitySet. Determines the pluralization.</param>
        /// <returns></returns>
        public static string CleanUpClassName(string tableName, bool isEntitySet)
        {
            string result = tableName;

            ePluralizerTypes classType = EnumFactory.Parse <ePluralizerTypes>(Settings.Pluralizer.ClassNames.Selected);

            PluralizerFactory factory = new PluralizerFactory();

            result = factory.SetWord(tableName, classType, isEntitySet);

            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs a proper property name based on the pluralizer settings in CondorXE Common tab.
 /// </summary>
 /// <returns></returns>
 public virtual string ToPropertyName()
 {
     if (this.Alias.ToLower() == _script.Settings.DataOptions.VersionColumnName.ToLower())
     {
         return(this.Alias);
     }
     else
     {
         if (!string.IsNullOrEmpty(_propertyName))
         {
             return(_propertyName);
         }
         ePluralizerTypes  propertyType = EnumFactory.Parse <ePluralizerTypes>(_script.Settings.Pluralizer.PropertyNames.Selected);
         PluralizerFactory factory      = new PluralizerFactory();
         _propertyName = factory.SetWord(this.Alias, propertyType);
         return(_propertyName);
     }
 }