private string GetTableName(ClassMapping classMap, CodeListConfigurationAttribute attr = null)
        {
            attr = attr ?? classMap.Type.GetCustomAttribute <CodeListConfigurationAttribute>(false) ?? new CodeListConfigurationAttribute();
            var tableName = classMap.TableName.Trim('`').TrimStart(Dialect.OpenQuote).TrimEnd(Dialect.CloseQuote);

            if (!attr.CodeListPrefix)
            {
                return(ConvertQuotes(NamingStrategy.TableName(tableName)));
            }
            if (tableName.EndsWith("CodeList"))
            {
                tableName = tableName.Substring(0, tableName.IndexOf("CodeList", StringComparison.InvariantCulture));
                tableName = "CodeList" + tableName;
            }
            else if (!tableName.StartsWith("CodeList"))
            {
                tableName = "CodeList" + tableName;
            }
            return(ConvertQuotes(NamingStrategy.TableName(tableName)));
        }
Esempio n. 2
0
 protected string GetTableName(string name)
 {
     return(NamingStrategy.TableName(name));
 }