An easier way to parse for folders, which do not contain files with a specified extension.
Fix CORS in Firefox
CORS is a hated word anyone working on Web Solutions might have encountered if your website is accessing another website or API. So how do you ensure your website is able to the required URL ? The first and easiest fix would be to include "Access Control" headers in your web.config. That should be it … Continue reading Fix CORS in Firefox
Search Tables with Known Column Name
Have you ended up in a situation wherein, you know the Column Name but you have no clue about the Table Name ? I recently came across the situation and following is one query which help me out of the situation.The Query is for Firebird Database.
Rethrow Exception
CA2200 : Rethrow to preserve stack details. That's one recommendation that as a developer you might have seen when running Code Analysis on your solution. So what does it mean ? What does the guilty code looks like and what is the correct way to throw exceptions. Lets start with incorrect code first. Considering following … Continue reading Rethrow Exception
Mocking IDispossible with “Using”
Mocking objects is integral part of Unit Testing. The nucleus of Mocking is Dependency Injection, which allows us to inject Mock object into the code. But what happens when programmer has used the "Using" keyword ? For Example, This makes it difficult to mock DbCommand. The solution lies in deploying Factory Pattern to create our CustomDbCommand. For … Continue reading Mocking IDispossible with “Using”
Batch Execution in Firebird
Executing a .sql file on Firebird Database can be quite a messy job. The lack of proper documentation and support would hurt you more when encountered issues and that is what I faced when I required to do execute contends of a .Sql File. Having understood that FbBatchExecution is the command I would required, I went to … Continue reading Batch Execution in Firebird
Exception Handling in Web API (Part 2): Exception Filter (Extended)
The Exception Filter implementation mentioned in the Part1 of the article is fairly simple and straightforward. But as you start supporting more and more Exceptions, the Cyclomatic Complexity of the "OnException" method would increase because of the "if" condition nature. A cleaner implementation of the Filter is shown below using Dictionary. Isn't that cleaner ?
Exception Handling in Web API (Part 1): Exception Filter
The Web World, especially Web Services is fast moving towards the more abstract simpler Web API. This article is not focused on comparing Web Service and Web API, but rather it focuses on Exception Handling in Web API. By default, the most common exception that an API Controller raises are translated into an HTTP Status … Continue reading Exception Handling in Web API (Part 1): Exception Filter
Hello World in Ext JS and ASP.Net MVC4
Javascript based frameworks has been evolving of late and one of the prominent among them is External Javascript, better known as Ext JS. Unlike some of its competitors like Angular JS, Ext JS distinguishes itself with a rich suite of UI components. It is cross browser compatible. I am delving more into details of Ext … Continue reading Hello World in Ext JS and ASP.Net MVC4
Specifying singular table names
Entity Framework usually generates Tables with plural names. For example, a Student class would generate a table Students. This could be a little inconvenience for teams who insists on plural names. The solution is to override the 'OnModelCreating' Method to remove the plural features. This would ensure plural names are used in every concerned Context. … Continue reading Specifying singular table names