src/GiveCRM.DummyDataGenerator/Generation/RandomSource.cs
/// <summary>
/// Returns a random element from the specified list.
/// </summary>
Returns a random element from the specified list.
Returns a random element from the specified list .
public T PickFromList<T>(IList<T> list)
        {
            if (list.Count == 0)
            {
                return default(T);
            }
            if (list.Count == 1)
            {
                return list[0];
            }
            int index = random.Next(list.Count);
            return list[index];
        }
public T PickFromList < T > ( IList < T > list ) { if ( list . Count == 0 ) { return default ( T ) ; } if ( list . Count == 1 ) { return list [ 0 ] ; } int index = random . Next ( list . Count ) ; return list [ index ] ; }
Returns a random element from the specified list.
Returns a random element from the specified list .
list
IList<T>