O'Reilly logo

Cross-platform UI Development with Xamarin.Forms by Paul F. Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Too much information!

Using * within the SQL query has an unfortunate drawback. It retrieves everything based on the parameters passed into the query. This could mean hundreds of objects returned to List.

As previously discussed, help is at hand. That help is in the form of LINQ.

Getting Linq'd

It should become apparent that LINQ is a powerful addition to the programmer's arsenal. To quote the grandfather of telesales, Billy Mays—but wait, there's more!

Finding data with LINQ

There are six ways of finding data within a collection:

  • Where
  • First and FirstOrDefault
  • Single and SingleOrDefault
  • Select
  • SelectMany
  • Last and LastOrDefault

Where

Where allows searching a collection based on any parameter within the collection. This will result in List<T> or IEnumerable<T> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required