Friday, February 04, 2011

When you validate

Please return why it didn’t validate by reference. Like this

public bool ValidateSearchParameters(AdvertSearchParameters advertSearchParameters, ref string errorString)
        {

           
if
(advertSearchParameters.IsTextSearch)
            {
               
if (advertSearchParameters.TextKeywords.Length < 5) //TODO : will be provided by config
                {
                    errorString =
"Must be more than 5 charachter."
;
                   
return false;
                }
            }
}
 
 

Life runs on code :)

No comments: