expandoobject Questions
7
I've noticed that the new ExpandoObject implements IDictionary<string,object> which has the requisite IEnumerable<KeyValuePair<string, object>> and Add(string, object) methods and...
Pettaway asked 6/5, 2011 at 10:54
12
In javascript you can detect if a property is defined by using the undefined keyword:
if( typeof data.myProperty == "undefined" ) ...
How would you do this in C# using the dynamic keyword with ...
Magalymagan asked 15/5, 2010 at 9:23
7
Solved
Am I doing something wrong, or is the following code really not possible?
dynamic x = new ExpandoObject { Foo = 12, Bar = "twelve" };
If this really isn't possible, is there another one-line way...
Kerrin asked 19/9, 2011 at 22:28
4
Solved
I would like to dynamically add properties to a ExpandoObject at runtime. So for example to add a string property call NewProp I would like to write something like
var x = new ExpandoObject();
x.A...
Wen asked 8/2, 2011 at 21:1
2
Solved
I have a JSON object, something like:
var jsonObject = {"att1" : "val1","att2" : "val2","att3" : "val3","att4" : "val4&quo...
Corrective asked 16/3, 2015 at 10:23
3
Solved
First I read txt files into a folder, and after I hydrated objects with expando Object.
But now I would like to get some value from this objects to fill a listview (winforms).
private void Form1_...
Tenner asked 21/4, 2017 at 15:13
3
Solved
Presently in LINQ, the following compiles and works just fine:
var listOfFoo = myData.Select(x => new FooModel{
someProperty = x.prop1,
someOtherProperty = x.prop2
});
public class FooModel{...
Norge asked 21/3, 2013 at 18:5
7
Solved
In python how can we create a new object without having a predefined Class and later dynamically add properties to it ?
example:
dynamic_object = Dynamic()
dynamic_object.dynamic_property_a = "a...
Phenica asked 23/12, 2012 at 23:41
7
Solved
I'm using Rob Conery's Massive ORM, and I haven't been able to bind the resulting ExpandoObject to a GridView.
I did find another Stackoverflow question that suggests using a framework called impr...
Lockup asked 6/4, 2011 at 22:44
2
Solved
I've got an ExpandoObject that I'm sending to an external library method which takes an object. From what I've seen this external lib uses TypeDescriptor.GetProperties internally and that seems to ...
Nihility asked 15/5, 2013 at 14:6
2
Solved
Something caught me by surprise when looking into C# dynamics today (I've never used them much, but lately I've been experimenting with the Nancy web framework). I found that I couldn't do this:
d...
Becki asked 6/11, 2014 at 11:38
2
Solved
I am getting an dynamic object of type "Sealed Class" from a driver api (in dll). I want to decorate this object with a few additional properties.
I would like to do something to the effect of:
p...
Lesialesion asked 11/4, 2016 at 19:43
2
Solved
I am using C# and trying to generate a JSON string from a dynamic object.
dynamic reply = new System.Dynamic.ExpandoObject();
reply.name = "John";
reply.wins = 42;
string json = System.Web.Helpers...
Jeanicejeanie asked 13/6, 2019 at 20:47
2
I need to "merge" 2 dynamic objects in C#. All that I've found on stackexchange covered only non-recursive merging. But I am looking to something that does recursive or deep merging, very much the ...
Lohner asked 27/1, 2012 at 17:10
4
I'm getting a JSON object (may contain multiple levels of JSON arrays and such) which I want to translate into an ExpandoObject.
I figured out how to add simple properties to an ExpandoObject at r...
Aqualung asked 30/11, 2012 at 22:16
4
Solved
What are the differences between System.Dynamic.ExpandoObject, System.Dynamic.DynamicObject and dynamic?
In which situations do you use these types?
Generalist asked 25/8, 2010 at 11:51
2
I've read a lot about how ExpandoObject can be used to dynamically create objects from scratch by adding properties, but I haven't yet found how you do the same thing starting from a non-dyna...
Sinegold asked 26/10, 2017 at 7:32
2
Solved
C# has the usefull Null Conditional Operator. Well explained in this answer too.
I was wondering if it is possible to do a similar check like this when my object is a dynamic/expando object. Let m...
Sidwell asked 17/10, 2017 at 12:55
1
Solved
I have an inherited .NET 4.0 application that runs as a Windows service. I'm not a .NET expert by any stretch, but after writing code for 30+ years I know how to find my way around.
When the servi...
Gast asked 28/2, 2017 at 22:1
1
Solved
Currently I have the following method-
public void CreateWorkbook<T>(List<T> ItemList)
{
PropertyInfo[] properties= typeof(T).GetProperties();
foreach (PropertyInfo prop in pro...
Stinkhorn asked 21/1, 2017 at 14:28
1
Here is the class:
class Foo
{
private void Boo()
{
// Body...
}
// Other members...
}
What I need is:
Create a Foo2 class at runtime which has a copy of all Foo class members.
In Foo2 c...
Leonardaleonardi asked 12/12, 2013 at 15:0
2
Solved
This is a very specific problem. Not quite sure how to even word it. Basically I am implementing the unit of work and repository pattern, I have a dynamic object that I convert to an int, but if I ...
Headmaster asked 21/10, 2016 at 19:46
2
In my Windows Store app I have a list populated with ExpandoObjects. Data binding works fine for the initial values, but not for an image property I set asyncronously after a file has been download...
Ptosis asked 29/11, 2012 at 7:17
4
Solved
I am attempting to display the results of a query in a WPF datagrid. The ItemsSource type I am binding to is IEnumerable<dynamic>. As the fields returned are not determined until runtime I do...
Fawnia asked 30/12, 2009 at 23:19
2
Solved
I'm using Jint to execute JavaScript in a Xamarin app. Jint is converting an associative array into an ExpandoObject. How do I use this object? Ideally, I'd like to get a dictionary of the data out...
Mathian asked 16/9, 2015 at 20:50
1 Next >
© 2022 - 2024 — McMap. All rights reserved.