Пример #1
0
        public string GetClassName(string tableName)
        {
            TableNameToClassName lookup = TableNamesToClassNames.FirstOrDefault(t => t.TableName.Equals(tableName));

            if (lookup != null)
            {
                return(lookup.TableName);
            }
            return(tableName);
        }
Пример #2
0
        private void Remove(TableNameToClassName tableNameToClassName, bool favorTable)
        {
            // favoring single return queries for readability; despite performance hit
            TableNameToClassName toRemove = favorTable ? TableNamesToClassNames.FirstOrDefault(c => c.TableName.Equals(tableNameToClassName.TableName)) : TableNamesToClassNames.FirstOrDefault(c => c.ClassName.Equals(tableNameToClassName.ClassName));

            if (toRemove != null)
            {
                TableNamesToClassNames.Remove(toRemove);
            }
        }
Пример #3
0
 public void Set(TableNameToClassName tableNameToClassName)
 {
     Remove(tableNameToClassName, true);
     Remove(tableNameToClassName, false);
     TableNamesToClassNames.Add(tableNameToClassName);
 }