by David | Feb 5, 2013 | Debugging, Development
I´m a big fan of neat constructs such as the yield return in C#. The yield return allows you to return results from a method line by line instead of summing it up in a list or such. You can see the difference between these two methods: public IEnumerable<string>...
by David | Feb 4, 2013 | Database, Development
Seems there´s still some issues you have to struggle with in Entity Framework even though the latest releases have made it actually possible to work with. This time I got a problem whilst trying to retreive av bunch of items logged with the same timestamp. Entity...
by David | Feb 15, 2012 | Database, Debugging, Development
Ever tried to build complex joins using Linq with Entity Framework and finally ending up with something you just suspect might be a hell of a lot less efficient than possible? In that moment it might prove useful to get the clean actual SQL your Linq query actually...
by David | Jun 2, 2011 | Development
Quite often I find myself wanting to check in a petite way if an enumerable is empty. Instead of having to do: bool notEmpty = myEnumerable.GetEnumerator().MoveNext(); Using linq you can simply use this System.Linq.Any() extension method: var notEmpty =...
by David | May 13, 2011 | Development
Ever faced any of these questions? My enumeration is empty!?Where did my items go?Why do Linq remove things I don’t want removed?Where´s the items in my Where?! I just did. Linq is a nice little feature but when using enumerations you really need to keep your...