private static SqlTableInformation CreateSqlTableInformation(string connectionString, string tableName)
        {
            var connection = SqlConnectionManager.GetConnection(connectionString);

            var columns = GetColumnsInfo(connection, tableName);

            // Checking if the necessary table exists
            if (columns.Count == 0)
            {
                return(null);
            }

            var tableInformation = new SqlTableInformation(tableName);

            foreach (var column in columns.Values)
            {
                tableInformation.AddColumnInformation(
                    new SqlColumnInformation(
                        column.Name,
                        column.IsPrimaryKey,
                        column.IsIdentity,
                        column.IsComputed,
                        column.IsNullable,
                        ConvertSqlTypeToSystemType(column.Type),
                        ConvertSqlTypeToSqlDbType(column.Type)
                        ));
            }

            return(tableInformation);
        }
        public ISqlTableInformation GetTableInformation(string connectionString, string tableName)
        {
            Verify.ArgumentNotNullOrEmpty(connectionString, "connectionString");
            Verify.ArgumentNotNullOrEmpty(tableName, "tableName)");

            string key = GetTableCacheKey(connectionString, tableName);

            if (!_tableInformationCache.ContainsKey(key))
            {
                SqlTableInformation sqlTableInformation = CreateSqlTableInformation(connectionString, tableName);
                _tableInformationCache.Add(key, sqlTableInformation);
            }

            return(_tableInformationCache[key]);
        }
        private static SqlTableInformation CreateSqlTableInformation(string connectionString, string tableName)
        {
            var connection = SqlConnectionManager.GetConnection(connectionString);

            var columns = GetColumnsInfo(connection, tableName);

            // Checking if the necessary table exists
            if(columns.Count == 0)
            {
                return null;
            }

            var tableInformation = new SqlTableInformation(tableName);

            foreach(var column in columns.Values)
            {
                tableInformation.AddColumnInformation(
                        new SqlColumnInformation(
                            column.Name,
                            column.IsPrimaryKey,
                            column.IsIdentity,
                            column.IsComputed,
                            column.IsNullable,
                            ConvertSqlTypeToSystemType(column.Type),
                            ConvertSqlTypeToSqlDbType(column.Type)
                        ));
            }

            return tableInformation;
        }