Top "Anonymous-types" questions

Anonymous types are data types which dynamically add a set of properties into a single object without having to first explicitly define a type

Why a Microsoft.CSharp.RuntimeBinder.RuntimeBinderException if the invoked method is there?

I have the following code which creates a dynamic object that is assigned to the smtpClient variable. public class TranferManager { …

c# reflection dynamic anonymous-types
In c# convert anonymous type into key/value array?

I have the following anonymous type: new {data1 = "test1", data2 = "sam", data3 = "bob"} I need a method that will take …

c# .net httpwebrequest anonymous-types
Cast List of Anonymous type to List of Dynamic Objects

Why can't I cast a List<AnonymousObject> to a List<dynamic>? I have this following code: …

c# .net-4.0 anonymous-types
How to set value for property of an anonymous object?

this is my code for example: var output = new { NetSessionId = string.Empty }; foreach (var property in output.GetType().GetProperties()) { property.…

c# .net anonymous-types
Passing anonymous type as method parameters

In my plugin architecture I am currently passing a plugin name (string), method name (string) and parameters (object array) to …

c# reflection anonymous-types
LINQ How to select more than 1 property in a lambda expression?

We often use the following lambda expression MyList.Select(x => x.Id).ToList(); Is possible to get more than 1 …

c# linq lambda anonymous-types
How to return a generic list collection in C#?

I have some linq to sql method and when it does the query it returns some anonymous type. I want …

c# .net generics anonymous-types anonymous-methods
Creating an anonymous type dynamically?

I wanna create an anonymous type that I can set the property name dynamically. it doesn't have to be an …

c# dynamic anonymous-types
C# ‘dynamic’ cannot access properties from anonymous types declared in another assembly

Code below is working well as long as I have class ClassSameAssembly in same assembly as class Program. But when …

dynamic c#-4.0 anonymous-types
Anonymous interface implementation in Golang

In Go, is there a way to satisfy an interface anonymously? It doesn't seem like there is, but this was …

go anonymous-types