I wanna declare new extension method which similar to List.ForEach Method.
What I wanna archive:
var dict = new Dictionary<string, string>()
{
{ "K1", "V1" },
{ "K2", "V2" },
{ "K3", "V3" },
};
dict.ForEach((x, y) =>
{
Console.WriteLine($"(Key: {x}, value: {y})");
});
How can I do that?
See Question&Answers more detail:os