Questions tagged [dynamicobject]

A Microsoft .NET Framework (version 4+) base class for specifying dynamic behavior at run time.

The DynamicObject class enables you to define which operations can be performed on dynamic objects and how to perform those operations. The DynamicObject class enables you to override operations like getting or setting a member, calling a method, or performing any binary, unary, or type conversion operation.

Inheritance Hierarchy

System.Object   
  System.Dynamic.DynamicObject

Reference: https://msdn.microsoft.com/en-us/library/system.dynamic.dynamicobject%28v=vs.110%29.aspx

171 questions
0
votes
1 answer

How do I create and populate a dynamic object using a dynamically built lambda expression

I'm trying to create and populate a dynamic object from a dataset that is only known at run time. In the code below, I create my IEnumerable results from my dataset with some known fields (ID, Primary Data, DisplayOrder, IsActive) and one…
Mark
  • 69
  • 10
0
votes
1 answer

How to SELECT dynamic type of objects in SQLiteAsyncConnection-

I'm trying to build a database using SQLiteAsyncConnection where all of it's queries comes from the server. database = new SQLiteAsyncConnection(dbPath); The server's queries are divided into two parts[execution & retrieval] for the execution…
Abozanona
  • 2,261
  • 1
  • 24
  • 60
0
votes
4 answers

How to handle dynamic elements using Robot Framework

I am currently working on the Robot Framework and using Selenium2Libraries to work on a Web Application. I'm working on a Form and I'm dealing with a dynamic elements which is an editable text area and drop down list.. I really hope someone would be…
0
votes
1 answer

C# Assign JSON DynamicObject to a Class

public class RootObject { public List results { get; set; } public int result_index { get; set; } } ... private void ReadJson() { string JsonString = File.ReadAllText(MyJsonFile); DynamicObject jObject =…
user2272143
  • 469
  • 5
  • 22
0
votes
2 answers

Empty result when converting DynamicObject to JSON

I've got a class inherited from DynamicObject. It contains all the properties stored in List: public class MyObject : DynamicObject { public List Properties { get; set; } } public class MyProperty { public string Name…
Waldemar
  • 5,363
  • 3
  • 17
  • 28
0
votes
1 answer

DynamicObject. How execute function through TryInvoke?

I want to execute static functions through DynamicObject, but I don't know how execute saveOperation without specifying the class name typeof(Test1) or typeof(Test2) . How relise this better? For example class DynObj : DynamicObject { …
askeet
  • 689
  • 1
  • 11
  • 24
0
votes
2 answers

Converting type of a property of a DynamicObject based on ReturnType

I have a dynamic type in C# (Content, a type that inherits DynamicObject). It wraps an inner JSON object containing the data. In TryGetMember I return the requested properties from this inner JSON object. This works just fine in case of simple types…
Miklós Tóth
  • 1,490
  • 13
  • 19
0
votes
1 answer

How to retrieve values by index from a dynamic Object

String zohoResponse = @" [ { 'Title':'Mr.', 'First Name':'ram', 'Last Name':'chang', 'Employed at Trade Client Name':'mile travel', 'Telephone':'657498333', …
kimmie
  • 21
  • 8
0
votes
1 answer

Adding Operation on DynamicObject

I have a subclass of DynamicObject, where I implemented several implicit operators (for automatic conversions) and overriden some Try[OperationType] methods. I get an exception when I try to make a add(+) operation with an object of that type…
Luís Antunes
  • 326
  • 2
  • 9
0
votes
0 answers

StackOverflowException from a simplest type extends DynamicObject

I've met a strange issue from a type extends DynamicObject. I even tried the sample from MSDN: // The class derived from DynamicObject. public class DynamicDictionary : DynamicObject { // The inner dictionary. Dictionary
Jeffrey Zhao
  • 4,923
  • 4
  • 30
  • 52
0
votes
0 answers

Vb.net Dynamic Properties on inherited objects

I cannot get this to work! I want to be able to create dynamic properties on derived classes that inherit from a base class that inherits from system.dynamic.dynamicobject? I have created a VB.net abstract class which I want to inherit from with…
0
votes
3 answers

In C#, how do I change a Key-Value-Property's value while recursively traversing an ExpandoObject?

The Problem Using C#, I need to traverse an object that has been cast to an ExpandoObject from XML and replace any "price" property with a new value. This object is very unstructured and has many layers of nested nodes (nested ExpandoObjects,…
Matt Cashatt
  • 23,490
  • 28
  • 78
  • 111
0
votes
1 answer

C# - GetMemberBinder split

I have a setting file that is formatted like so: [Database] Host=localhost Username=root Password=root Now, I have a class named Settings which is a DynamicObject so I can use dynamic settings. When I parse the file, the key for the dictionary that…
user3865229
  • 125
  • 2
  • 9
0
votes
0 answers

How to create objects dynamically from json string in C#?

I am new to C# programming. I am getting a Json string as input, How can I create a dynamic objects from json strings and access the values from object. My Json string structure is not constant, Hence, I cannot go with predefined class structure. My…
Manu
  • 67
  • 2
  • 3
  • 8
0
votes
1 answer

How to dynamically create class objects with serial naming?

Suppose I take an integer user input - 17. Now I want to create 17 "Node" class objects. And they'll be named like node1, node2, ..., node17. How to achieve that?
Buggy Coder
  • 383
  • 5
  • 17