Add Service Reference – How to Avoid Generating Already Existing Classes Today I was asked how to avoid generating an already existing client class when we use the Add Service Reference menu item in Visual Studio . The Problem In the e-mail I got the question was regarding the use of ValidationResults (from the Validation Application Block ) as a return type for a WCF Service . When they try to Add Service Reference to the service it is generating a new ValidationResults class for the use in...
Self Validation in Validation Application Block There are times when you don’t find a solution for a validation you need inside Validation Application Block validators. When this is happening Self Validation can help you to keep using VAB and gaining all its abilities. This post will explain how to use Self Validation in VAB . What is Self Validation? Self validation gives you the ability to implement validation logic inside the class you want to validate. When you have a complicated validation or...
Don’t Repeat Yourself Today while I was doing code review I found myself writing a new generic function instead of one piece of code that was repeating itself in the developer’s code. When you write code sometimes you have to duplicate some piece of code. When it occurs, this is the best time to think of refactoring your functionality. A lot has been written about DRY principal this post is my opinion about it. The DRY Principal Don’t Repeat Yourself or DRY is a very good practice when we are writing...