I Have a Dictionary Dictionary<int, Foo> fooDic as it’s value is a class and Foo has a property _barName i Need all the names from fooDic as a CSV string…
for example..
var fooDic = new Dictionary<int, Foo>()
{
{ 0, new Foo { _barId = 10, _barName = "some value" } },
{ 1, new Foo { _barId = 15, _barName = "some Foo value" } },
{ 2, new Foo { _barId = 25, _barName = "some Foobar value" } }
};
I need output as
string result = "some value, some Foo value, some Foobar value";
Please Share your ideas/solutions, How it can be achieved?
Like this:
Take a look:
http://ideone.com/F4bLU