expandoobject Questions

1

Solved

I'm trying to write a generic utility for use via COM from outside .NET (/skip long story). Anyway, I'm trying to add properties to an ExpandoObject and I need to get PropertyInfo structure back to...
Beyond asked 31/8, 2015 at 13:16

2

Solved

I have a list which contains a dictionary of ExpandoObjects. Im binding this to a grid but now I want to sort the list. var rows = new List<dynamic>(); for (int i = 0; i < 1000; i++) ...
Eisteddfod asked 23/3, 2012 at 14:48

1

Solved

I need to loop over a List<dynamic> objects. The list's objects all have values, but for some reason, I am not able to access any of the dynamic object fields. Below is a screenshot of my de...
Shade asked 12/5, 2015 at 10:16

12

Solved

I really like the ExpandoObject while compiling a server-side dynamic object at runtime, but I am having trouble flattening this thing out during JSON serialization. First, I instantiate the object...
Association asked 1/3, 2011 at 15:39

3

Solved

Can I cast ExpandoObject to anonymous type ? var anoObj = new { name = "testName", email = "testEmail" }; dynamic expandoObj = new System.Dynamic.ExpandoObject(); // Here I'm populating the expa...
Elmaleh asked 20/4, 2012 at 7:11

3

Solved

i have this dynamic d = new ExpandoObject(); d.Name = attribute.QualifiedName.Name; so , i know that d will have a property Name. Now if i don't know the name of the property at compile time , ...
Gillen asked 3/12, 2011 at 15:59

1

I want to add an attribute to property of a dynamic object/expando object runtime, is it possible? What I would like to do is: dynamic myExpando = new ExpandoObject(); myExpando.SomeProp = "strin...
Tellurium asked 11/12, 2013 at 21:19

5

Solved

given the code below dynamic e = new ExpandoObject(); var d = e as IDictionary<string, object>; for (int i = 0; i < rdr.FieldCount; i++) d.Add(rdr.GetName(i), DBNull.Value.Equals(rdr[i])...
Awed asked 13/10, 2011 at 20:26

1

Solved

I wonder if it is possible to query ExpandoObject with regular LINQ? Reason is that I have dynamic ExpandoObject but I need to do some querying before I can pass further. It has some properties th...
Sacrosanct asked 11/9, 2013 at 16:56

3

I need inputs in converting an dynamic xml to defined c# object model My sample xml is as below : <?xml version="1.0" encoding="utf-8" ?> <Persons> <Person> <Id>10</...
Buttonball asked 20/5, 2013 at 12:33

2

Solved

Is there any limitations on the kind of characters that I can use to create a property for a dynamic object? Is there a list of characters that I cannot use (e.g. / * @)?
Counterweigh asked 8/5, 2013 at 15:41

2

Solved

I would like to see if a property exist in a C# Expando Class. much like the hasattr function in python. I would like the c# equalant for hasattr. something like this... if (HasAttr(model, "Id"...
Fortunia asked 20/8, 2012 at 20:14

2

Solved

Say that I have a class, Foo, looking something like this: public class Foo : IFoo { public Foo() { Bars = new List<dynamic>(); } public IList<dynamic> Bars { get; set; } } The ...
Algorithm asked 10/4, 2013 at 8:35

1

Solved

For example, there's an object like the next one: public class Container { public object Data { get; set; } } And it's used this way: Container container = new Container { Data = new Dictiona...
Puling asked 16/3, 2013 at 22:12

1

Solved

I am working with expando object and I am trying to define a calculated property. I know that I can define a simple property by doing something like the following: dynamic myExpando = new Expando...
Crossbreed asked 11/2, 2013 at 16:28

4

Solved

Say I have this object: dynamic foo = new ExpandoObject(); foo.bar = "fizz"; foo.bang = "buzz"; How would I remove foo.bang for example? I don't want to simply set the property's value to null...
Trubow asked 23/1, 2013 at 23:52

1

Solved

I'm trying to create a dynamic list of objects because I don't know what properties my objects will have until I read them from a file. So suppose I have the properties of my object inside an arra...
Balfore asked 7/1, 2013 at 15:36

2

Solved

I have a simple list of expando objects called products. i add various fields to these objects at runtime ( for example color or size) How can i write a LINQ query on this list based on dynamic ...
Expressivity asked 26/3, 2011 at 22:16

2

Solved

Here is my code: public static class DynamicExtensions public static void Add(this ExpandoObject obj, string path){ dynamic _obj = obj; if (_obj == null) throw new ArgumentNullException("obj")...
Obstetric asked 19/9, 2012 at 19:44

1

How can I imitate the functionality of the ExpandoObject in a .NET 3.5 application with the least overhead? My best lead so far is to use the Lin Fu framework ( http://www.codeproject.com/KB/cs/Lin...
Triable asked 9/2, 2011 at 21:27

2

Solved

Is there a way to add a property to an ExpandoObject with the same name as a string value? For example, if I have: string propName = "ProductNumber"; dynamic obj = new System.Dynamic.ExpandoObjec...
Overcash asked 6/4, 2012 at 19:44

1

Solved

I'm using a custom implementation of a DynamicObject which works perfectly for my application, other than the fact that I'm running into some performance issues. Some performance overhead is to be ...
Papillote asked 2/3, 2012 at 22:48

3

I have an ExpandoObject with an arbitrary number of properties. I want to persist those properties to a MongoDB database as a BsonDocument. I try to do so with the following code: private BsonDocu...
Caracara asked 22/2, 2011 at 1:42

1

Solved

I am trying to implement C#'s ExpandoObject-like class in Scala. This is how it is supposed to work: val e = new ExpandoObject e.name := "Rahul" // This inserts a new field `name` in the object. p...
Giff asked 20/10, 2011 at 7:19

3

Solved

dynamic model = new ExpandoObject(); model.Data = "asdf"; List<dynamic> listOfx = new List<dynamic>(); for (int i = 0; i < 3; i++) { dynamic x = new ExpandoObject(); x.I...
Premiere asked 19/10, 2011 at 22:25

© 2022 - 2024 — McMap. All rights reserved.