Exemplo n.º 1
0
 public Airport GetAirport(long id)
 {
     return((Airport)AdoTemplate.QueryForObject(CommandType.Text,
                                                "SELECT * FROM airport WHERE id = @id",
                                                airportMapper, "id", DbType.Int32, 0, id));
     //
     //return (Airport) QueryForEntity("SELECT * FROM airport WHERE id = @id", id, this.airportMapper);
 }
Exemplo n.º 2
0
        public User get(int id)
        {
            IDbParametersBuilder builder = CreateDbParametersBuilder();

            builder.Create().Name("id").Type(DbType.Int32).Value(id);

            return(AdoTemplate.QueryForObject(CommandType.Text, @"SELECT * FROM tb_user WHERE id = :id", new Tb_userRowMapper(), builder.GetParameters()) as User);
        }
Exemplo n.º 3
0
        public Airport GetAirport(string code)
        {
            return((Airport)AdoTemplate.QueryForObject(CommandType.Text,
                                                       "SELECT * FROM airport WHERE code = @code",
                                                       airportMapper, "code", DbType.String, 0, code));

            /*
             * IDbCommand command = GetCommand("SELECT * FROM airport WHERE code = @code");
             * IDbDataParameter parameter = command.CreateParameter();
             * parameter.ParameterName = "@code";
             * parameter.DbType = DbType.String;
             * parameter.Value = code;
             * command.Parameters.Add(parameter);
             * return (Airport) QueryForEntity(command, this.airportMapper);
             */
        }
Exemplo n.º 4
0
 public TestObject FindOne()
 {
     return(AdoTemplate.QueryForObject(CommandType.Text,
                                       "",
                                       new TestObjectRowMapper()));
 }
Exemplo n.º 5
0
 public Customer GetCustomer(string contactName)
 {
     return(AdoTemplate.QueryForObject(CommandType.Text, cmdText,
                                       new CustomerRowMapper <Customer>(),
                                       "ContactName", DbType.String, 30, contactName));
 }
Exemplo n.º 6
0
 public Aircraft GetAircraft(long id)
 {
     return((Aircraft)AdoTemplate.QueryForObject(CommandType.Text, SingleAircraftById, aircraftMapper,
                                                 "id", DbType.Int32, 0, id));
 }