コード例 #1
0
ファイル: Examples.cs プロジェクト: wolfester/Sequelocity.NET
// AppendCommandText

        public void AppendCommandText_Example()
        {
            const string sql = "SELECT TOP 1 * FROM SuperHero;";

            DatabaseCommand databaseCommand = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.SqlServerConnectionString)
                                              .SetCommandText(sql);

            // Imagine there is some conditional logic here where we need to add additional queries to the database command
            const string moreSql = "\nSELECT TOP 1 * FROM AlterEgo;";

            databaseCommand.AppendCommandText(moreSql);
        }