Tech Blog

Linq First vs Single

By: Chris Dunn on Tue Feb 19, 2019 (3 min read)

What's the difference between LINQs Single method and First method? While they can both return the same result, they serve a different purpose depending on the underlying sequence of data. Using the wrong method can cause problems in your code now, and as your data grows. First() First() should be used on sequences of data with a count of one or more. This method is returning the "FIRST" of possibly "MANY". If there are no results an exception will be thrown. One option, in this case, is to use ...

Parse CVS Data with LINQ

By: Chris Dunn on Tue Jul 10, 2018 (4 min read)

In the world of BIG DATA we're dealing with more than just JSON, XML and SQL.  A lot of data comes in raw Comma Separated Values (CSV) format.  A number of times in the past I've imported CSV data into SQL server and queried the data that way.  With LINQ, we now possess that same concise query power (somewhat) in our code. It gives us some more options especially if we don't want the weight of a database (or server) for a client application. Also, if you're starting to get involved in machine le ...

Copyright 2019 Cidean, LLC. All rights reserved.

Proudly running Umbraco 7. This site is responsive with the help of Foundation 5.