1 #region MIT license 2 // 3 // MIT license 4 // 5 // Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne 6 // 7 // Permission is hereby granted, free of charge, to any person obtaining a copy 8 // of this software and associated documentation files (the "Software"), to deal 9 // in the Software without restriction, including without limitation the rights 10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 // copies of the Software, and to permit persons to whom the Software is 12 // furnished to do so, subject to the following conditions: 13 // 14 // The above copyright notice and this permission notice shall be included in 15 // all copies or substantial portions of the Software. 16 // 17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 // THE SOFTWARE. 24 // 25 #endregion 26 27 namespace DbLinq.Vendor 28 { 29 /// <summary> 30 /// Represents aliases for table names or types. 31 /// Depending on the implementation, search maybe case insensitive or schema insensitive 32 /// </summary> 33 #if !MONO_STRICT 34 public 35 #endif 36 interface INameAliases 37 { 38 /// <summary> 39 /// Returns a type name for a given table. 40 /// </summary> 41 /// <param name="table">The table to look for</param> 42 /// <param name="schema">An optional schema (or null)</param> 43 /// <returns>Type name or null if no alias found</returns> GetTableTypeAlias(string table, string schema)44 string GetTableTypeAlias(string table, string schema); 45 /// <summary> 46 /// Returns a member name for a given table (used by the main database classes). 47 /// </summary> 48 /// <param name="table">The table to look for</param> 49 /// <param name="schema">An optional schema (or null)</param> 50 /// <returns>Member name or null if no alias found</returns> GetTableMemberAlias(string table, string schema)51 string GetTableMemberAlias(string table, string schema); 52 /// <summary> 53 /// Returns a member name for a given column. 54 /// </summary> 55 /// <param name="column">Column name</param> 56 /// <param name="table">The table to look for (parameter may be ignored depending on implementation)</param> 57 /// <param name="schema">An optional schema (or null)</param> 58 /// <returns>Member name or null if no alias found</returns> GetColumnMemberAlias(string column, string table, string schema)59 string GetColumnMemberAlias(string column, string table, string schema); 60 61 /// <summary> 62 /// Returns a member type for a given column. 63 /// Please note that DbLinq may not handle correctly the forced type 64 /// </summary> 65 /// <param name="column">Column name</param> 66 /// <param name="table">The table to look for (parameter may be ignored depending on implementation)</param> 67 /// <param name="schema">An optional schema (or null)</param> 68 /// <returns>Member type or null if no alias found</returns> GetColumnForcedType(string column, string table, string schema)69 string GetColumnForcedType(string column, string table, string schema); 70 71 /// <summary> 72 /// Returns whether the given column is generated 73 /// </summary> 74 /// <param name="column">Column name</param> 75 /// <param name="table">The table to look for (parameter may be ignored depending on implementation)</param> 76 /// <param name="schema">An optional schema (or null)</param> 77 /// <returns>Member type or null if no alias found</returns> GetColumnGenerated(string column, string table, string schema)78 bool? GetColumnGenerated(string column, string table, string schema); 79 80 81 /// <summary> 82 /// Returns whether the given column is generated 83 /// </summary> 84 /// <param name="column">Column name</param> 85 /// <param name="table">The table to look for (parameter may be ignored depending on implementation)</param> 86 /// <param name="schema">An optional schema (or null)</param> 87 /// <returns>Member type or null if no alias found</returns> GetColumnAutoSync(string column, string table, string schema)88 DbLinq.Schema.Dbml.AutoSync? GetColumnAutoSync(string column, string table, string schema); 89 GetDatabaseNameAlias(string databaseName)90 string GetDatabaseNameAlias(string databaseName); GetClassNameAlias(string className)91 string GetClassNameAlias(string className); 92 } 93 } 94