LINQ

  • Thread starter Thread starter Arne Garvander
  • Start date Start date
A

Arne Garvander

Every LINQ example I have seen returns an IQuerable<T> . I am expecting a
single discret value or a miss match. How do I retrieve a single record thru
LINQ?
How do I handle errors in LINQ?
 
Arne

One line is First in a Catch and Try block.

As it fails it gives an error.

An other method is to use FirstOrDefault and try if the the result is not
null.

Cor
 
Back
Top