359 questions
1
vote
1
answer
61
views
How can I declare a dynamic property name starting with an @
I need to create the following JSON:
{
"@context": "https://schema.org",
"@type": "Event",
"name": "The Adventures of Kira and ...
0
votes
1
answer
60
views
Convert JSON string to dynamic, update property, convert back to JSON
When I need to call an API to update a complex object, what I want to do is:
GET - Read down the object (as a JSON string).
Convert to a dynamic object.
Write the new value(s) to the properties I'm ...
0
votes
0
answers
38
views
UWP ExpandoObject PropertyChangedEvents are not Updating UI
My task is to implement a UWP DataGrid with dynamic columns. As the user adds and remove columns, I need to add and remove the corresponding properties during runtime from the ObservableCollection of ...
0
votes
0
answers
86
views
Getting Property from ExpandoObject causing error
I have an Expando Object ("points") with a property called "in". There is another property called "duration". points.duration returns as expected, but points.in throws ...
0
votes
1
answer
200
views
Accessing dynamic view within ExpandoObject
I have the following method to create this ExpandoObject:
List<object> example = new List<object>();
foreach (var rate in rates)
{
var rateObject = new ExpandoObject() as IDictionary&...
0
votes
0
answers
49
views
Is possible to parse a string as function and reference runtime variables?
I'm trying ExpandoObjects to accomplish custom calculations on some customer data.
For example, there exists some class as (short version):
public class Seller
{
public Guid Id { get; set; }
...
0
votes
1
answer
629
views
In Powershell how do "ExpandProperty" of multiple values?
Seems like this should be simple enough.
get-childitem -path "E:\Test 1" -Recurse -File | foreach-Object { $fsize=(get-Item $_.FullName).Length ; $hash=(get-FileHash $_.Fullname -Algorithm ...
1
vote
1
answer
422
views
ExpandoObject with dynamic deserialized JSON throwing an exception when trying to access a property
I have a dynamic JSON string (the structure can change depending on the content sent by the server). I'm deserializing it using Newstonsoft.Json as a dynamic ExpandoObject
dynamic jsonMeta = ...
0
votes
0
answers
69
views
convert a list(of ExpanoObject) to list of objects
I am trying to convert a list(of ExpanoObject) to list of objects with the code below
Dim li As List(Of ListItem) = items.Select(Of ExpandoObject)
(Function(itm As ExpandoObject)
New ...
0
votes
0
answers
77
views
Add Properties ya fields in a C# Dynamically based on length of a list [duplicate]
Let's say that I have a a list of elements of 'n' size. I want to add 'n' properties in a dynamic object .How can I achieve this? We can't just hard code it because length of list is dynamic.
So an ...
1
vote
1
answer
1k
views
Getting values of ExpandoObject from Keys that are known at runtime
I am using CsvHelper to read a CSV file so I can write "some" of its columns to somewhere else. I don't have the name of headers beforehand so I couldn't use ClassMapper . However I can get ...
0
votes
1
answer
1k
views
Issue with reading dynamic data from DataTable in QuestPDF
I'm trying to figure out how to populate table with data coming from DataTable using QuestPDF.
I'm currently using JSON as a data source. The JSON is formatted like this:
{
"Brother MFC (60)&...
1
vote
2
answers
527
views
C# Code for Moq's Setup and it's Return in regards to mocking a dynamic property
Here is info about our technical development environment :
.NET Core 3.1
PostgreSQL 14.2, compiled by Visual C++ build 1914, 64-bit
EntityFramework.Functions Version=1.5.0
Microsoft....
0
votes
0
answers
51
views
Cannot cast object type to representative class with same properties
I have an ExpandoObject (recordValue in this example) that I traverse through and I need to extract the value for given key. For that purpose, I do the following:
var objectValue = recordValue.Where(x ...
0
votes
1
answer
142
views
How to fill datagrid with datatable in uwp and make the grid editable?
Need to populate a Datagrid in UWP with a Datatable.
I could display the contents by following:
https://stackoverflow.com/a/53767049/12053338
However, I am unable to edit the datagrid.
How do I make ...