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

All Questions

Tagged with
0 votes
2 answers
154 views

Using LINQ, group list of object combination inside another list of objects

Update: Change class name as ComboProduct and Product for clear public class Product { public string Name {get; set;} } public class ComboProduct { public int Id; public List<Product&...
Khanh Nguyen Van's user avatar
1 vote
1 answer
38 views

I am having an issue where I am unable to set objectA = objectB without getting all empty properties on objectA

I have tried several methods, 3 can be seen in the code below, the other was setting each property on the customer.ReconnectStats = to the corresponding property on the rs object. The fields on the rs ...
Steve S's user avatar
  • 89
-1 votes
2 answers
86 views

How to insert each object from the array of objects into the corresponding object in c#?

This thing is easy, so please give me a reference if there is one or answer. I have a array of different non-repeatable objects, e.g object[] data { Cat, Dog, Bird }; So I need to insert each object ...
Marija Magdalena Bašić's user avatar
0 votes
2 answers
88 views

List<object>: how to apply a "where" for some index element?

I've this kind of List of object: .AsEnumerable().Select(p => new List<object>() { p.ID, p.DateActivity.HasValue ? p.DateActivity.Value.ToString("yyyyMMdd") : null, p....
markzzz's user avatar
  • 47.4k
0 votes
1 answer
88 views

deserialize json in c# from the web in a c# console app

Basically I am trying to make the class I made for the object be able to read out indivual items so I can use them. I am having trouble with the foreach loop Here is a copy of the Json I want to read /...
Adam Mohammed Dabdoub's user avatar
-2 votes
1 answer
68 views

Am I completely misunderstanding how to Equals and/or EqualSequence in C# LINQ [duplicate]

Please take a look at the screenshot. I am comparing two lists of objects that seem to be equal to me. Why are both Equals and EqualSequence false?
FriendNotFoe's user avatar
0 votes
2 answers
512 views

Adding objects to IEnumerable

Im making a basic CSV Reader. Im sepparating the header from the contents using header and data. Now, my lists contain data of the type person.: public class person { public int id; ...
Rarowcun's user avatar
  • 113
-1 votes
1 answer
574 views

How to reference a class from other class with foreign key in C#?

I would like to have in the object UserPassword a field with a Object User,that has all the attributes of User(uuid,name,rol...) Code of UserPassword : [Key] public Guid Uuid { get; set; } ...
Mario Galán's user avatar
0 votes
2 answers
167 views

How to distribute a list of objects in a new reorganized list of objects having an embedded list in order to change the root primary key/index?

I want to convert list of NoteModel objects to list of objects as following. Final result should be contain list of GroupNoteModels objects which contains Date and list of GroupItemModel objects with ...
Alexander Raymak's user avatar
0 votes
2 answers
140 views

C# Inheritance between classes, lists and objects

I have created a list that contains an object, that contains a list of objects. I want to retrieve the values from an inherited/child class object, that is in the parent classes list/object. Its a bit ...
Testnominiee's user avatar
2 votes
2 answers
855 views

C# Lambda Expression for iterating through nested objects

I have below JSON which I have de-serialized into a C# object and would like to extract the values of INFO_CARD_ID, DOCUMENT_NUM and REVISION_NM at each iteration. { "result": { &...
Vishwanath jawalkar's user avatar
-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 ...
Farzad Karimi's user avatar
0 votes
2 answers
2k views

C# - convert a list of objects to an array of multiple of the object's properties

I have this JSON string: { "countries": [ { "countryCode": "AR", "country": "Argentina" }, { "countryCode": &...
adim's user avatar
  • 129
-1 votes
1 answer
424 views

Sorting Dictionary with child dictionary of object value type [duplicate]

I have a Dictionary<string, Dictionary<string, object>> that needs to be sorted depending on a certain value of the child dictionary. e.g { "James": { "Age": 21, ...
Stephan Badenhorst's user avatar
1 vote
1 answer
281 views

C# - Ternary operator between Dictionary and Object[]

How i can implement a ternary operator between a Dictionary type and a array of objects in C#? I tried bellow, but gives me error: System.Collections.Generic.IEnumerable<System.Collections.Generic....
Hudson Medeiros's user avatar

15 30 50 per page
1
2 3 4 5
8