Thursday, October 09, 2008

Linq: Split string array and convert into integer using a converter / lambda and then selecting where in or contains from that list

// This will split an CSV string array into an array of integers
int[] intArr = Array.ConvertAll( priorityCsv.Split(','), n => Convert.ToInt32(n) );

//This will select the count of values where there are in or contain the values in the array
return (from v in this.Context.VACompanyErrors where intArr.Contains(v.Priority) select v).Count();

3 Comments:

At 3:56 AM, Anonymous Tera Gold said...

Nice choice… hope lot of dofollow blog will follow. it will gain more PR though.. Here useful link:Tera Gold Tera Online Gold

 
At 11:27 AM, Anonymous Anonymous said...

Do the math...Wearing cheap ass red polyester wedding dress is not worth it when you expected to pay big dowry to marry lazy husband!

 
At 5:15 AM, Blogger hou said...

Keep it up.Enjoy when you can, and endure when you must. it ls a good article and love your words.
xiaomi mi5 review
meizu m2 note
meizu mx5

 

Post a Comment

<< Home