I’ve read some articles on how to create anonymous types in C#.
What are some use cases for these things? To me, it seems like it might make things a little more difficult to understand declaring objects and their members inline.
When does it make sense to use Anonymous Types?
I like to use anonymous types when I need to bind to a collection which doesn’t exactly fit what I need. For example here’s a sample from my app:
Here I then bind a datagrid to payments.ToList(). the thing here is I can aggregate multiple objects without havign to define an intermidary.