Screenshot_10_26_14__7_52_pm_large

Khalid Abuhakmeh

Goodbye To My iMac

Times they are a changing

In 2011, I bought my first Apple machine. A supercharged 27-inch iMac with a gorgeous display, one that is still breathtakingly vibrant to this day. In addition to the amazing display, the iMac has some amazing speakers, internal microphone, and a 720p camera. That made it perfect for me, your neighborhood friendly remote consultant. I did my . . .

Read More

May 17, 2015

Fix Swashbuckle and Swaggers Duplicate Parameters Issue for WebAPI

Update (May 14th 2015): Fixed the solution, please read further down.

Swashbuckle is a great library for automagically creating a Swagger documentation page, but it doesn't play nice with the thunderdome principle, also known as the one model in, one model out approach.

Let's take a look at an example of what I am . . .

Read More

May 13, 2015

Fixing ASP.NET MVC Authentication Infinite Redirects

"Follow your nose! It always knows!"

ASP.NET MVC is a great framework, dare I say that I love it. While my fondness for the framework goes deep, it is not without its flaws. One of those flaws, is the implementation of the AuthorizeAttribute. The implementation of the AuthorizeAttribute encompasses both authentication and authorization responsibilities, violating the single . . .

Read More

May 12, 2015

Don't Forget Implicit Conversion Operators in C#

We are currently working on a new WebAPI filtering library that will allow consumers of our API to pass in expressive strings to denote ranges. We modeled it after the versioning behavior found in Nuget. You can see the range defining string on the left, where the right side is the expected behavior.

1.0 = 1.0  x
(,1.0] = x  1.0
 . . .

Read More

May 10, 2015

Trim All Strings In A WebAPI Response

Not for the squeamish

Every bit is crucial when returning a response to an API consumer. Reviewing our current API, I noticed that some of our data was loaded incorrectly with invisible whitespace trailing some columns. This is a simple oversight, seeing that our data is imported from other sources. It is easy enough to fix via a database update, but could crop up . . .

Read More

May 08, 2015

Answering a RavenDB Document Modeling Question

Over 2 years ago, I wrote a blog post on Tech.pro called "Basics of RavenDB NoSQL. Recently, Kamran Ayub asked these questions:

Is it a good idea to simply store a single Following (per your example, 37 million documents for Bieber alone)? Another approach could be to store followers in a single document per user, but I . . .

Read More

May 07, 2015

Detailed Sorting Validation Messages for WebAPI Using FluentValidation

On April 29th, I wrote the post "ASP.NET WebAPI and Multi-Column Sorting Queryables". The code in that post allowed any WebAPI user to sort requests based on the representation returned via the response.

Imagine we had the following object:

{
 name : 'Khalid',
 age : 31
}

Our sortable fields . . .

Read More

May 07, 2015

Archive

All Categories: c#(2) elasticsearch(2) oss(1) home