All Questions
123
questions
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.
...
-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",
...
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" : "...
-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 ...
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 ...
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 ...
-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 ...
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 ...
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;
}
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...