You can use First/FirstOrDefault.
Person p = per.FirstOrDefault();
FirstOrDefault
would return the first Object from the list or null
if the List is empty.
You can also use Single / SingleOrDefault, if you are expecting only one item back from the list or only one or null (for SingleOrDefault
)
Make sure that you have included using System.Linq;
namespace