C# Anonymous types cannot be assigned to -- it is read only

Anonymous types in C# are immutable and hence do not have property setter methods. You'll need to create a new anonmyous type with the values

obj = new { Name = "asdasd", Price = 11.00 };

Anonymous types are created with read-only properties. You can't assign to them after the object construction.

From Anonymous Types (C# Programming Guide) on MSDN:

Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to first explicitly define a type.


Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to first explicitly define a type. The type name is generated by the compiler and is not available at the source code level. The type of the properties is inferred by the compiler. The following example shows an anonymous type being initialized with two properties called Amount and Message.

http://msdn.microsoft.com/en-us/library/bb397696.aspx