LINQ Support in Visual Studio 2015 Debugger Awesome

image.png

I’ve been wanting to do this for a very long time.  I’m in the debugger of Visual Studio 2015 and I have some data structure that is a collection of objects.  To find what I want, I’ve had to either write ugly conditional debugging statements or put in some temporary c# if statements to stop on what I wanted and examine it. Now, I can just write the LINQ code in the watch window of Visual Studio and see exactly what I want.  Check out the screen shot below and notice that I just typed in: meetupResults.results.Select(a=>a.urlname).ToList() and I got exactly what I wanted. Very nice! … Continue Reading

Name Collisions with Asp.Net Webapi and How to Avoid

I love the simplicity of using ASP.NET WebAPI for building simple web rest services.  No special calls to create JSON, simple REST conventions implemented with the methods GET,POST,PUT and DELETE and very straight forward interfaces. The thing that annoys me is the naming convention.  In my case, I’ve create a folder /rest on my web server and I put all my WebAPI controllers there.  An example of a controller looks as follows: [crayon-55eabfae59d5b977842998/]   The problems comes up when you decide you want to have a different FAQ controller for different parts of the web site.  The obvious solution is to drop the REST services into sub directories.  Unfortunately, since the class name above does not … Continue Reading

WebAPI REST Routing For AngularJS and ExtJS

As most of my readers know, I’ve done a lot of work with the JavaScript libraries made by Sencha (ExtJS and SenchaTouch).  The typical JSON sent down to the requesting web application looks like the following with both Sencha products. { "data": [ { "shirtSize": "Mens-4XL", "id": 30 }, { "shirtSize": "Mens-5XL", "id": 31 }, { "shirtSize": "Mens-6XL", "id": 32 } ], "total": 34, "success": true } Notice that it is a single JavaScript object that has a property named data which is the array we are interested in. AngularJS’s Resource api expects just the data array by default without the nice wrapping with total and status.  That is, Angular just … Continue Reading

Tuples In C#, A Useful Example

Background Last year I worked consulted with a company that had an engineer that used tuples in C# and tried to explain to me how they were useful.  To be honest, I never quite saw the value proposition (until today).  I remember he kept saying they were kind of like key value pairs but could go beyond that.  I remember those words but never internalized that. The Example My example is a simple one.  I’m currently working on providing data to an external application that will provide business intelligence (help with session selection) to the Silicon Valley Code Camp web site.  The data I’m providing is every mark of interest and plan to attend for every session ever given at code camp (that’s 220,000 … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: