vendredi 31 juillet 2015

Why BLToolkit inserts \0 instead of '@' symbol in generated queries?

I use BLToolkit with mysql and when I try to insert a record to a table, I am getting a query like this:

INSERT INTO `P`
(
    `Name`
)
VALUES
(
    \0Name
); 

As you can see, this not the best mysql query.

Classes:

public class P
{
    [PrimaryKey]
    [Identity]
    public int? ID  { get; set; }
    public string Name  { get; set; }
}

The code for inserting:

var p = new P();
p.Name = "asdf";
p.ID = (int) db.InsertWithIdentity(p);

Do you know, what is going on?

Aucun commentaire:

Enregistrer un commentaire