All Questions
88
questions
0
votes
0
answers
19
views
Model Creation for Dynamic property in C# [duplicate]
Existing data:
existing = {
"MediaLRN" :'2',
"Media":'a.2',
"CultureDetails":{
"24 Hrs": [
{
"Organism": "15&...
1
vote
0
answers
105
views
How to cast object to Anonymous T
I'm having a problem casting with C#
First, my auxiliary functions for better understanding
public static class Extensions {
public static IEnumerable<T> ToEnumerable<T>(this T value) {...
0
votes
0
answers
82
views
Problem with dynamic variable in C# | MongoDB
I am writing this post today because I am currently stuck on a part of MongoDB
I want to upload a custom class, in a dynamic variable, but when I create a document on Mongo, the dynamic variable is ...
-1
votes
2
answers
43
views
Need clarity over what happens when you cast an object to value or reference type compared to using Dynamic in a class property, Using C#
So have this property Value in a class.
I need an interchangeable type of property for Value as wont know the type until it arrives from the DB and can be either reference or value type
(see examples ...
0
votes
2
answers
137
views
Best way to Deserialize JSON to Dynamic using C#
I'd like to know which is the best way do Deserialize to Dynamic, using NewtonSoft.Json and C#
The code below works, but I didn't like it. I would like to simplify it, using "named properties&...
-1
votes
1
answer
74
views
Finding dynamically generated components Unity
I have a game object and I'm generating a component for that object by
var arcGISMapViewComponent = gameObject.AddComponent<ArcGISMapViewComponent>();
under the Void Start()
However, I have ...
0
votes
1
answer
51
views
Dictionary<string,dynamic> behaves differently when used in function where built than when used out of function, why?
Using debug in VS 2019 on Windows Server 2019. I'm loading a Dictionary<string, dynamic> in a function to be used throughout the program. When I extract the dynamic object (o) from the ...
0
votes
1
answer
342
views
Get the value of the property of the object whose name begins with a number
I'm fetching data from website that returns me an object in a string like this:
{
index: 1,
commentNumber: 20,
feedComments: {
3465665: {
text: "I do not agree&...
1
vote
1
answer
195
views
JsonConvert.DeserializeObject object from API using Webclient that could be one of 2 Object types
I am trying to access the FitBit API, with C# .Net Core 3.1
https://dev.fitbit.com/build/reference/web-api/sleep/
However, for sleep data, it could return the SleepJSON object or a Meta object that ...
-2
votes
2
answers
2k
views
Change property value of a C# Dynamic type [closed]
Is there any way to change a dynamic type property value ?
Code Example:
dynamic result = new { Status = "WARNING", Modified = false, Message = string.Empty };
result.Status = "OK";...
-1
votes
1
answer
138
views
change value of a member of a list of type anonymous
I have a list of anonymous objects, that each anonymous object has the same members, and I create this list by something like this :
var listWorthies = balanceWorthies.Select(w => new
...
0
votes
0
answers
60
views
Read An Object In C# Which Is Created By Object.defineProperty In JavaScript
in my JavaScript code section, an object is created with DefineProperty like this :
$("td", tr).each(function (index, td) {
var field = $(td).attr("data-field");
...
1
vote
3
answers
970
views
How to get values from dynamic array?
I have deserialized the string by using the dynamic object.
Because property names dynamically changed. so can't able to deserialize with DTO objects.
Please find the code snippet:
var result = "[...
1
vote
2
answers
86
views
how to get varriable name over another one c#?
string MyVar1 = "bilah bilah";
dosometing(MyVar1);
void dosometing(object MyObject)
{
string VarName = nameof(MyObject); // it givess : "MyObject"
}
But I ...
-1
votes
2
answers
493
views
How do I get a value from a Json in .NET 3.5 C#?
On .NET 4.5 I was getting by
string respString= response.Body; // { "name":"John", "age":30, "car":null}
var respObj= JsonConvert.DeserializeObject<dynamic&...