Tag Archives: Anonymous Types

Ajax Webmethods, Javascript, and Anonymous Types… Booyah

As witnessed in this super awesome post I showed how to use a webmethod to get server side information with client side methods. (I know, I’m pretty sweet.) And in this one I had an example of filling a drop down list with a web method and javascript, though it was more about the anonymous [...]

Leave a comment Continue Reading →

C#, Var, and Objec- Propert- I have no idea what the term is

So I caugh this the other day and I’m not really sure it’s useful but it got me thinking… Say you have a string and you want to create what ReSharper calls a “implicitly typed local variable declaration”, or as most people know it as “var”, and intialize it with a created value: String someThing [...]

Leave a comment Continue Reading →

And then you hit the wall.

So as this dynamic nonsense continues, there is a sticking point to how much fun I can have. The wall? Anonymous types and generic declarations. Here’s the old: Func<User, Int32> selectUserID = currentUser => currentUser.UserID; Great if I want to select userIDs, but what if I want UserIDs AND UserNames… Easy right? userList.Select(currentUser => new [...]

Leave a comment Continue Reading →

Join By Anonymous Types in Linq

Just found this out yesterday so I thought I would post and pass on to all two of you reading this. Suppose you have a User table and a Contacts table and you wanted to find all the users that match up with the contacts table. Now suppose there is no direct correlation. What to [...]

Leave a comment Continue Reading →