I wish to get just the very first record I realize the the \"Take() will not work.
So I have a List that queries another list
List etch
Use the FistOrDefault method to safely return the first item from your query, or null if the query returned no results:
var result =
(from vio in AddPlas
where etchList.Any(vioID => vio.Key.Formatted.Equals(vioID))
select new
{
EtchVectors = vio.Shapes.FistOrDefault()
})
Or equivalently:
var result = AddPlas.Where(x => etchList.Any(y => x.Key.Formatted.Equals(y)))
.Select(x => new { EtchVectors = x.Shapes.FistOrDefault() });