Exemplo n.º 1
0
        public void AddParameter_Example_Providing_A_DbParameter()
        {
            DatabaseCommand databaseCommand = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.SqlServerConnectionString);

            var dbParameter = databaseCommand.DbCommand.CreateParameter();

            dbParameter.ParameterName = "SuperHeroName";
            dbParameter.Value         = "Superman";
            dbParameter.Direction     = ParameterDirection.InputOutput;

            List <SuperHero> superHeroes = databaseCommand
                                           .SetCommandText("SELECT * FROM SuperHero WHERE SuperHeroName = @SuperHeroName")
                                           .AddParameter(dbParameter)
                                           .ExecuteToList <SuperHero>();
        }