One of my friend Kritul Rathod had gave his understanding of Action keyword in C#. Passing the functions as parameters helps in many ways, here are basic ones It helps separate the coding logic (for some trivial things like exception handing, type conversions, Verbose Logging, etc – the things that clutters the code) from the actual… Continue reading Use of Action (Function programming) for better code health
Step by Step install FxCop with Visual Studio
We are going to install FxCop and integrate it with Visual Studio when a project is build. All violations of FxCop rules will be viewed in Warnings tab of Visual Studio and the build will fail. Install FxCop : Click here Edit the .csproj and add below tag under the last <PropertyGroup> tag and just above the… Continue reading Step by Step install FxCop with Visual Studio
StyleCop : Setting Rule explained
We will try to understand how to write the XML content to suppress rules. The sample XML can be found in the older post here. Lets try to understand the XML attributes & tag in below mentioned points: AnalyzerId : You have to mentioned the class name of the rule often found in warning or… Continue reading StyleCop : Setting Rule explained
StyleCop : Global Rule Suppression
We want to suppress rules of style cop for all the projects in the developer machine. As you can get few information from the documentation both on global rule setting and rule suppression. Below mentioned are 2 ways to merge them both: Editing the Settings.StyleCop in notepad Go to the installation location of StyleCop (possible location:… Continue reading StyleCop : Global Rule Suppression
Step by Step implement StyleCop custom rules with Visual Studio – Part 2
This is Part 2 of 2 Part series on implementing custom StyleCop rules. Please read Part 1 here, if you haven’t already read. Now download the code of creating the custom rules from here. Make sure you perform following steps to build it, in case you are unable to build: Installation location of StyleCop will… Continue reading Step by Step implement StyleCop custom rules with Visual Studio – Part 2
Step by Step implement StyleCop custom rules with Visual Studio – Part 1
Instead of starting with an introduction of StyleCop, I would like you to read “Why should we use StyleCop?“. There is enough help on how to integrate StyleCop with Visual Studio, one can be found here. This article is focused on step by step implementation to add custom rules that we used in our project. Install… Continue reading Step by Step implement StyleCop custom rules with Visual Studio – Part 1
Know your version of Web Application
Once the web application is published to production, after a while it becomes difficult to know exactly which version is in production. One of the way to find it without any ambiguity is to flash the version number on the footer tag next to copyright text. Code in aspx page Code in Codebehind page
Quick loading image for all ajax call
We have very common need of displaying some loading animation while ajax call is going on background. There have been lots of help out there. Here is another repetitive version of it. It should work to any of the application out there. In the above code make following changes Add a JQuery reference to your… Continue reading Quick loading image for all ajax call
Another Coding rules!
During some learning I came across 10 rules here with corresponding How-To #10 Avoid regions :: Refactor into smaller methods #9 Use Exceptions For Errors :: Only for errors not for execution branching #8 Avoid Boolean Parameters :: Create local Properties instead or using 2 different methods one for true and one for false. #7 Avoid Too Many Parameters :: Refactor to Create… Continue reading Another Coding rules!
JQuery : Learning basics Part 2
Code sample that will help you jump start JQuery. Read the previous post here. All the best for learning JQuery.