All Questions
3,849
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.
...
0
votes
3
answers
48
views
C# object list that can be declared, returning an iteration of items to be inserted into the main list
C# question.
I need to fill my main object property, that is a list of a custom object, but at some point, I need to add to this list a replication with a specific declaration, but I don't want to ...
1
vote
3
answers
70
views
Unable to cast to object
I had a code:
var result = BOBase.Search(Mapper.SourceBrowserType, searchCriteria);
var list = new List<IBO>(result.OfType<IBO>());
But I need to be able to add many elements in a list. I ...
0
votes
0
answers
333
views
how to pass object to test method in nunit in c#
How can I pass an object while testing with NUnit in c#
Hi
I have written some code and am trying to use NUnit Test. When I pass int or string it works but I dont know how to use this test method with ...
-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",
...
1
vote
1
answer
67
views
C# maintaining HasChanged for class of list properties
I am converting my code from datasets to list of class objects. For checking if any value in list is of object is modified or added or deleted, I am using object tracking technique.
My code is as ...
1
vote
1
answer
98
views
Creating child classes that only inherit parents data once
Currently I'm trying to create some attribute let's call it "DoNotShareWithGrandChildren" that will be used by the highest level parent class but not the children classes below it. The issue ...
0
votes
2
answers
515
views
Convert List<object> to List<model> type with only the model name c# mvc
So I'm trying to create a generic function (currently it's not but I wanted to future proof it, so in a later stage the tableName can be picked/passed through).
I want to use the string ...
-1
votes
1
answer
98
views
C# Json.NET hide objects (not properties) when serializing
I want to hide objects (not properties) when serializing with Json.Net.
The situation is:
In a list of images, there are many images, including attributes such as Class, Name, and Layers. Within the ...
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 ...
0
votes
2
answers
1k
views
Add new property to existing object - c#
When both 'if' condition is satisfied, I want Start to be added to the same DataList along with value and time.
public List<object> DataList = new List<object>();
if(somecondition)
{
...
-1
votes
2
answers
52
views
How to output the values of List<int> from an object. (Not list of objects) C#
I am inputting information from a json file and then need to check that the information is correct. I am not sure how to print out the values of a List from an object. Not all objects have the same ...
-3
votes
2
answers
167
views
System.NullReferenceException Object reference not set to an instance of an object (List) [duplicate]
public List<Faculty> Faculties {get;set;}
List<Faculty> faculties = FacultiesManager.Faculties;
Faculties.Add(something);
how can i interact with the object list
0
votes
0
answers
113
views
Can I create a C# object containing a form's controls and their properties?
I'm currently working on a Windows Forms application in C#. At the moment, I have four forms that have multiple controls of a variety of different types (textboxes, datagrids, labels etc) and I ...