public static T GetRandomItemFromList <T>(IList <T> list) { if (list == null || list.Count == 0) { return(default(T)); } return(list[RandomProxy.Next(list.Count)]); }
private string FillInRandomDataFromNumber(string format, char symbol = '#') { var result = format.ToCharArray(); for (int i = 0; i < result.Length; i++) { if (result[i] == symbol) { result[i] = (char)(RandomProxy.Next(10) + 48); } } return(new string(result)); }