convenience function to copy from any IEnumerable into any IList

This commit is contained in:
Michael Becker 2021-08-16 09:03:32 -04:00
parent de9149ea8c
commit 99606449ad
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -46,5 +46,16 @@ namespace MBS.Framework.Collections
list.Add(null);
return list.ToArray();
}
/// <summary>
/// Convenience function to copy from any <see cref="IEnumerable" />
/// into any <see cref="IList"/>.
/// </summary>
public static void CopyTo(this IEnumerable source, IList dest)
{
foreach (object o in source)
{
dest.Add(o);
}
}
}
}