Query a list in another list in C#
<p>I have a class like that</p>

<pre><code>public class Tbl
{
    public List&lt;Row&gt; Rows {get; set;}
}
public class Row
{
    public string Name {get; set;}
    public Value {get; set;}
}
//Using the class  
//Add rows to Tbl
Tbl t = new Tbl();
t.Rows.Add(new Row() {Name = "Row1", Value = "Row1Value"};
t.Rows.Add(new Row() {Name = "Row2", Value = "Row2Value"};
t.Rows.Add(new Row() {Name = "Row3", Value = "Row3Value"};

//Now I want to select the Row2 in this list, usually, I use this way
public Row GetRow(this Tbl t, string RowName)
{
    return t.Rows.Where(x =&gt; x.Name == RowName).FirstOrDefault();
}
Row r = t.GetRow("Row2");
//But I would like to use that way
Row r = t.Rows["Row2"];
</code></pre>

<p>How can I do that.</p>

<p>Thanks for every comments.</p>
