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
2
votes
1 answer

Enum values for Office interop via dynamic object

I am using COM interop for Word automation within my Silverlight-Ouf-Of-Browser application. This means that I can't reference COM directly but instead I rely on dynamic. Now I would like to call the following…
ollifant
  • 8,576
  • 10
  • 35
  • 45
2
votes
2 answers

How to Dynamically call a method of a class if class name is passed as string

I want to create dynamic object so that I call the respective method of the class. All classes and interface is in different file but under the same folder Given: interface Method { public void display(); } class Car implements Method { …
sakshi singhal
  • 101
  • 2
  • 9
2
votes
1 answer

XML-RPC.NET and C# Dynamic Types

The Cook Computing blog has a post discussing how dynamics in .NET 4 could be used to create dynamic RPC calls. (Post: ALTERNATIVE SYNTAX FOR MEMBER CALLS ON C# DYNAMIC TYPES ) The post shows the following example: using System.Dynamic; class…
Larry Hipp
  • 6,205
  • 3
  • 26
  • 31
2
votes
4 answers

Have anybody created an open source dynamic .NET class for exposing private functions/properties on another class?

And if so, I would very much like to use it. Does anybody have any pointers? My goal is to remove the need for _accessor projects in my test solution. I figured that if I created a dynamic class, it should be possible to record what functions are…
Arve
  • 7,284
  • 5
  • 37
  • 41
2
votes
0 answers

C# Check the values of dynamic object properites while debugging

I encountered a WCF service which returns a dynamic object. But in debug mode the properties of dynamic objects were not allowed to visible. How to see dynamic object property values while debugging. Image is attached.
Aslam Jiffry
  • 1,306
  • 6
  • 23
  • 57
2
votes
1 answer

Delegating dynamic object resolution to other instances

I'm currently hosting IronPython in a .NET 2.0 application. I want to create a class (in C#) whose instances can be "extended" by plugin instances. That means, each member access which is unresolvable on my instance should be forwarded to the…
2
votes
1 answer

Is it possible to dynamically add properties to an entity object?

is it possible to add properties at run-time to a class that was generated by the entity framework? I am successful in doing so with POCO classes that inherit from DynamicObject but when I try to do the same thing with my entity classes, I receive…
HBCondo
  • 895
  • 3
  • 10
  • 26
2
votes
1 answer

C# dynamic how to get the value

How to get the value of the dynamic object? i post the screenshot of the sample data. I'm new to c# and have no idea on object in c#. [HttpPost] [Route("api/TCSAPI/SaveTCS")] public HttpResponseMessage SaveTCS(dynamic tcsObject) { var track =…
user7305885
2
votes
1 answer

Is winform PropertyGrid able to edit dynamic object?

As we know that by default the winform PropertyGrid is able to edit properties of a predefined class. However, some times we might need to edit dynamic created objects. Refer to the code below: ParamForm.Show(new { Firstname = "John", Lastname =…
mind1n
  • 1,196
  • 3
  • 15
  • 34
2
votes
1 answer

When/Why should I use late-binding? (DynamicObject and ExpandoObject)

While DynamicObjects and ExpandoObjects (Differences between ExpandoObject, DynamicObject and dynamic) sound quite useful at first, i did never actually use them. It feels like late-binding is quite unsafe/unstable since it might throw errors at…
H W
  • 2,556
  • 3
  • 21
  • 45
2
votes
3 answers

Store type information with DynamicObject

I'm trying to design a process for doing extract transform load operations. I want to use the ExpandoObject in my pipeline to allow me to easily add columns to my data stream. Basically I read data from some kind of datasource cast it a dynamic…
herps
  • 23
  • 2
2
votes
1 answer

ICustomTypeProvider or DynamicObject

I'm looking to bind to a class that exposes its properties dynamically as per the code below. It seems that both ICustomTypeProvider and DynamicObject would work for this. Can anybody explain why I might want to use one over the other? void…
pastillman
  • 1,104
  • 2
  • 16
  • 27
2
votes
1 answer

Servicestack ORMLite/Massive managing multiple DataTables with Expandos / Dynamic?

i have a Stored Procedure that returns multiple datatables with dynamic types according to the input and I cannot modify or split it. I actually retrieve the data in this way: var massiveModel = new DynamicModel(dbConn.ConnectionString); …
2
votes
1 answer

Setting all properties of dynamic object in anonymous type in linq query

I need to convert dynamic objects (i.e. List) to a List of anonymous type objects but I need to have all the properties of the dynamic object to be created into an anonymous type object at run time either using linq or some other way. Is…
Thierry
  • 6,142
  • 13
  • 66
  • 117
2
votes
1 answer

RhinoMocks expectation with dynamic parameter

Is there anyway to mock an method that takes a dynamic parameter? I want to set an expectation like this: _hasher.Expect(h => h.ComputeHash(Arg.Matches(o=> o.PropertyA == "123"))).Return("some hash"); I get error: An expression tree may…
Eric
  • 890
  • 1
  • 7
  • 9