Using below extension method we can add a multiple values to a typed collection in one go.
//add value to collection in one statement
public static void AddRange(this ICollection list, params S[] values)
where S : T
{
foreach (S value in values)
list.Add(value);
}
9:52 AM
Rajesh Rolen
0 comments:
Post a Comment