Question: I have a problem. I created a dictionary like this:

```
var TriangleRegistry = new Dictionary<string, TriangleRegistryObject>();

```

With a class like this:

```
class TriangleRegistryObject
{
    public double x1 { get; set; }
    public double y1 { get; set; }
    public double x2 { get; set; }
    public double y2 { get; set; }
    public double x3 { get; set; }
    public double y3 { get; set; }
    public bool Selected { get; set; }
}

```

The dictionary is filled with coordinates of triangles. Now, I know x1, y1, x2, y2, x3, y3 and I want get the value of `Selected` of the right triangle using x1, y1, x2, y2, x3, y3.

Its important that I use all 6 values to find the 7th, because I got a lot of triangles!  

Can someone help me?

Answer: 
You can do that by using LINQ (as posted above/below) or for each loop and check wash variable. In most cases LINQ is slower alot so if your application requires a better performance - consider using for each / etc.
You can use LINQ to query your dictionary and find a match:

```
using System.Linq;

...

var matches = TriangleRegistry.Where(t => t.Value.X1 == ... && t.Value.Y1 == ...); // fill in the blanks here with whatever you're looking for
foreach (var match in matches)
{
   Console.WriteLine("Here's a match: {0}", match.Selected);
}

```