I would like to assign an object in a list using Linq, but I can't find how to do it. I tried this:
Items.Where(i => i.Code == line.Code).Single() = line;
But it seems I simply cannot give the statement an object. I can modify properties of those objects (Like this) :
Items.Where(i => i.Code == line.Code).Single().name = line.name;
But giving it the full item doesn't seem to be accepted. Is there a reason to prevent this / a way to assign my value to the compatible item ? Thank you for your answer.