For example, say if I have a the following lists of dictionaries: List<Dictionary<string, object>>
customer =
[ {Customer: 1, Name: Bob},
{Customer: 2, Name: Sam},
{Customer: 3, Name: Rob},
{Customer: 4, Name: Sally}
]
Purchase =
[ {Customer: 1, Item: Bat, Cost: 20},
{Customer: 1, Item: Baseball, Cost: 10},
{Customer: 3, Item: Basketball, Cost: 10},
{Customer: 4, Item: Hat, Cost: 10}
]
I want to join these two lists of dictionaries on a common field, similar to SQL inner joins. How would I use LINQ to join on the Customer field?
[
{Customer: 1, Name: Bob, Item: Bat, Cost: 20},
{Customer: 1, Name: Bob, Item: Baseball, Cost: 10},
{Customer: 3, Name: Rob, Item: Basketball, Cost: 10},
{Customer: 4, Name: Sally, Item: Hat, Cost: 5}
]
Please help! Thanks!
Edit: This is my first time asking a question on here so apologies if it was not as detailed.