In my SQL SERVER I have a field Poids (type: Varchar) and when I tried to convert it to Decimal I had this error: "LINQ to Entities ne reconnaît pas la méthode 'System.Decimal Parse(System.String)'" . This my code:
var list = db.Réception.Where(y => y.Supprimée == false).
Select(x => new
{
Id_rec = x.Id_rec,
N° = x.N°,
Date_rec = x.Date_rec.ToString(),
heure_rec = x.heure_rec.ToString(),
Qualité = x.Qualité.Qualité1,
Poids = x.Wg.AsEnumerable().Where(y => y.Id_rec == x.Id_rec).Select(w => decimal.Parse(w.Poids)).Sum(),
Nbwg =x.Wg.Where(y => y.Id_rec == x.Id_rec).Count()
});
Please if someone can help me I'm blocked and I tried some solutions in web but without results.