I want to check the duplicate values in the list and bring the prices together.
Follow the example below.
ex.
var list = new List<Item>();
list.Add(new Item() { code= "521523", text= "cookie", price= 5});
list.Add(new Item() { code= "521523", text= "donut", price= 20 });
list.Add(new Item() { code= "521524", text= "coffee", price= 15 });
list.Add(new Item() { code= "521524", text= "water", price= 16 });
list.Add(new Item() { code= "521525", text= "other", price= 16 });
result
code= "521523", text= "cookie", price= 25
code= "521524", text= "coffee", price= 31
code= "521525", text= "other", price= 16