problème avec linq (modifier une table)
Bonjour,
pour être bref voilà le code
Code:
1 2 3 4 5 6 7 8 9
| public void update(Func<Produit, bool> condition, Action<Produit> chargement)
{
Produit[] cls = (mdb.Produits.Where(condition)).ToArray<Produit>();
foreach (Produit c in cls)
{
chargement(c);
}
mdb.SubmitChanges();
} |
puis on utilisant cette fonction
Code:
1 2 3 4 5 6 7 8
| try
{
gg.update(p => p.FullName=="nom", p => p.FullName = "nom_i");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message+"\n"+ex.Source);
} |
J'obtiens cette exception:
Citation:
There was an error parsing the query. [ Token line number = 3,Token line offset = 1,Token in error = WHERE ]
quelqu'un peut m'aider?
Merci.