"abc3def".Any(c => char.IsDigit(c)); Update : as @Cipher pointed out, it can actually be made even shorter: "abc3def".Any(char.IsDigit);... Read More
Let doesn't have its own operation; it piggy-backs off of Select. You can see this if you use "reflector" to pull apart an existing dll. it will be something like: var result = names .Select(... Read More
You need to introduce your join condition before calling DefaultIfEmpty(). I would just use extension method syntax: from p in context.Periods join f in context.Facts on p.id equals f.periodid into f... Read More
Yes, all of those are correct. And ILookup<TKey, TValue> also extends IEnumerable<IGrouping<TKey, TValue>> so you can iterate over all the key/collection pairs as well as (or instead of) just looking... Read More
Easiest approach: myList = myList.ConvertAll(d => d.ToLower()); Not too much different than your example code. ForEach loops the original list whereas ConvertAll creates a new one which you need to r... Read More
List<string> myList = new List<string>(); IEnumerable<string> myEnumerable = myList; List<string> listAgain = myEnumerable.ToList();... Read More
Well, I'd expect it's this line that's throwing the exception: var documentRow = _dsACL.Documents.First(o => o.ID == id) First() will throw an exception if it can't find any matching elements. Given... Read More
Use where list.Contains(item.Property) Or in your case: var foo = from codeData in channel.AsQueryable<CodeData>() where codeIDs.Contains(codeData.CodeId) select codeData; But you... Read More
For joins, I strongly prefer query-syntax for all the details that are happily hidden (not the least of which are the transparent identifiers involved with the intermediate projections along the way... Read More
You can use Contains() for that. It will feel a little backwards when you're really trying to produce an IN clause, but this should do it: var userProfiles = _dataContext.UserProfile... Read More