Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
2 votes
2 answers
279 views

Getting all values of properties of an object into an array in c#

Im trying to get all the field values of an object into an array. but the problem is the fields of the object can have other types rather than string but ultimately all the values should be a string. ...
DBankx's user avatar
  • 21
-2 votes
2 answers
103 views

Want to access dynamic property name from dynamic object

I have following JSON format. { "data": [ { "id": 1, "variants": [ { "name": "Test", ...
Sami In's user avatar
  • 330
0 votes
4 answers
233 views

Not able to parse the object in C# .NET

I am not able to parse the below object in C# .NET. I am getting parsing object error. messageBody (in String format - I am getting this below object in string format) { "Type" : "...
Hardik Parmar's user avatar
-1 votes
1 answer
138 views

Add element to a List when delcaring new object

Is there a way to add elements to a List when doing this: var Foo = new MyClass() { PropertyList = MyList, Id = Id, } I would like to add elements to PropertyList. For example would be the ...
ludovicoilgrande's user avatar
0 votes
0 answers
383 views

How to populate an object inside of an object and call it whenever in C#

So I have an object (Location) This Location Object contains what is a Location I have also added another object that is a Venue on the last line. namespace EngageServicesEditor.Core { public ...
DaLegacy's user avatar
  • 132
0 votes
1 answer
43 views

Pattern guidance serialised DTO and Generics

I am looking for some pointer into best pattern regarding the following objective. I have multiple services that I would like to send Jobs but will contain meta data that will form separate object ...
KeithMac's user avatar
-1 votes
1 answer
1k views

How to use POST request to create an object in C# API?

So I'm trying to make this parking ticket system and I'm currently creating these objects manually in the code for testing. Now I've come to the step where my POST request in postman should be able to ...
Suzdar Ibrahim's user avatar
0 votes
0 answers
61 views

Global objects in C# ASP.Net - always null when read back

In an ASP.Net project, using C#, I have a class (PlcComms.cs) for talking to a Controller (a PLC). I want the one class object to be globally available, for each web page in my project. I see from ...
ianRobo75's user avatar
0 votes
1 answer
730 views

How to create more than one object from user input in c# console app?

in class File: class Employee { //PROPS public string Name {get; set;} public int Id {get; set;} //CONST. public Employee (string name, int id){ Name = name; Id = id; } ...
dosnetCore's user avatar
0 votes
1 answer
45 views

How can I convert an list of object to an array of list of object with each array index having 2 count?

I hope everyone is doing well in this crisis. Alright, so here is my list of objects with the object containing a name and value: What I like to do with this list of the object is that I need to ...
Mazhar Khan's user avatar
0 votes
1 answer
172 views

JObject to anonymous object with unkown type structure | C#

Im trying to convert a JObject to an object. I have a WEB-API with ASP.NET framework where I get an Request-Object which has a object-property. This object-property has a completely unkown structure ...
Robert Wolf's user avatar
3 votes
3 answers
2k views

How do I cast an object to another object type with all the same properties except the new type has one more field

I am trying to cast the type skill to type SkillViewModel. This is where I try the cast: SkillViewModel skillViewModel = (SkillViewModel)skill; This is my skill model that I am trying to ...
jenkamin-benbins's user avatar
0 votes
0 answers
20 views

Assign values to a class of object [duplicate]

I have a class like below. When I'm assigning values to it , It shows "Object reference not set to an instance of an object" public class Student { public string Name{ get; set; } public ...
Sajith's user avatar
  • 113
0 votes
1 answer
168 views

Replacing <Frameset> with <Object>, Can I dynamicaly change one of the Object URLs without reloading the entire page?

I'm replacing a classic asp website with asp.net, c# code behind. Need to be HTML5 compliant, so I replaced the existing Frameset page with a similar page using the HTML object data Attribute. There ...
pmcs's user avatar
  • 71
0 votes
2 answers
51 views

How can I pass an object from a view to a different controller on submit in MVC5?

First time asking a question on here and fairly new to .NET so apologies in advance! (Any help greatly appreciated!) I've got a controller and a create view for a 'Builder' class which stores user ...
Aaron Robinson's user avatar

15 30 50 per page
1
2 3 4 5
9