ConsoleApp1/Helpers/UserInputValidator.cs
/// <summary>
/// Check if input parameter is in category collection
/// </summary>
/// <param name="inputCategoryName"></param>
/// <returns></returns>
Check if input parameter is in category collection
Check if input parameter is in category collection
public static ValidationOutcome JokeCategoryValidate(string inputCategoryName)
        {
            var _categoryList = new ChuckNorrisService().GetCategoriesAsync().Result;
            return _categoryList.Contains(inputCategoryName) ? ValidationOutcome.ValidationSuccess 
                : ValidationOutcome.ValidationInvalidInputGeneric;
        }
public static ValidationOutcome JokeCategoryValidate ( string inputCategoryName ) { var _categoryList = new ChuckNorrisService ( ) . GetCategoriesAsync ( ) . Result ; return _categoryList . Contains ( inputCategoryName ) ? ValidationOutcome . ValidationSuccess : ValidationOutcome . ValidationInvalidInputGeneric ; }
Check if input parameter is in category collection
Check if input parameter is in category collection
None
inputCategoryName
string
None