Showing posts from April, 2015

Extract all MVC / WebApi area/controller/actions

I did some search and created my own based on the answers found in SO.

Extract all MVC / WebApi area/controller/actions - Gist

// // // // // // /// <summary> /// Extract all MVC/WebApi area/controller/actions /// </summary> publicclassResourceHelper { privateconststring NamespacePrefix = "github"; publicstatic List<ApplicationResource> GetResources() { var resources = new List<ApplicationResource>()…

Bing-Mail Easy Post Api - Version 1.3 - C#

Recently I had a chance to integrate an awesome and innovative postal mailing API ( in my system. However I ran into some problems because their code samples were in PHP and doing the same from .NET was giving me errors. Finally I found a solution and may be someone out there will benefit from it.

The most frustrating error I had to fix was uploading files as a PUT HTTP method with Digest Authentication.

Complete solution except some easy-to-figure-out methods are posted in this gist. Bing-Mail Easy Post Api - Version 1.3

What i did was modified the DigestAuthFixer from to support any HTTP method.

Then used that to create the session, when we create the session using DigestAuthFixer it stores the Digest-Auth headers which i can reuse when uploading the files.
 using (var client =newWebClient()){var uri =newUri(_easypostHosts[2]+UploadUri.FormatWith(sessionId,HttpUtility.UrlEncode(fileName)));// get the auth heade…

Upgrading to ASP.NET Identity 2 - Then Fix Errors

I am working on a MVC5 project but a lot of libraries it has referenced were outdated. Therefore I just opened up "Managed Nuget Pkgs For Solution" and clicked on update all button. It did update all and then I was so happy, i built the project, and ran it.

Lucky Me! I got these errors. Sounds familiar?

The model backing the 'ApplicationDbContext' context has changed since the database was created. This could have happened because the model used by ASP.NET Identity Framework has changed or the model being used in your application has changed. To resolve this issue, you need to update your database. Consider using Code First Migrations to update the database (  Before you update your database using Code First Migrations, please disable the schema consistency check for ASP.NET Identity by setting throwIfV1Schema = false in the constructor of your ApplicationDbContext in your application.       public ApplicationDbContext() …