Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
62 views

I created a class to calculate a Exponential Moving Average: public class ExponentialMovingAverage { public Int32 Period { get; set; } public ExponentialMovingAverage(Int32 period = 20) { ...
Miguel Moura's user avatar
0 votes
0 answers
49 views

I have the following data in a List object; List<FailedMachines> lstObjects: lstObjects[0] - Desc: Mach1 Name:Drill Id: 1 lstObjects[1] - Desc: Mach1 Name:Crane Id: 1 lstObjects[2] - ...
user57358's user avatar
  • 139
-2 votes
1 answer
62 views

I have an ICollection<Plante> Jardin which I want to sort according to some property Plante.Taille: private readonly ICollection<Plante> Jardin; I use the instance method ...
Gui Gui's user avatar
1 vote
1 answer
439 views

I'm exercising on one task. Basically i got 3 different lists in C# code side. Class employee is containing the skills list. And also have list of employees as well. for example : class Employee { ...
Aԃιƚყα Gυɾαʋ's user avatar
0 votes
1 answer
1k views

I have a requirement to create an object 'factory' that works as follows: Accepts a list of matching object types. Compares each property value in the list to see if they match. Returns a new single ...
Bandito's user avatar
  • 329
0 votes
2 answers
544 views

I have a collection of users, each with a child collection of memberships. And then I also have a club collection. The child collection of each user is populated with memberships containing a club ID ...
maze_dk's user avatar
  • 193
0 votes
2 answers
654 views

I have an instance variable _foo declared like so - List< Dictionary<int, HashSet<int> > > _foo; Yes, it is a messy data structure that is a List of Dictionaries whose key is an ...
Happy Green Kid Naps's user avatar
1 vote
1 answer
217 views

I have a collection of objects entering a method as an IEnumerable of which I am grouping them by a reference property and then processing them group by group. The processing involves mutating the ...
tvandinther's user avatar
0 votes
2 answers
663 views

I have a type of non-ordered records: public class Row { public string Client { get; set; } public string Account { get; set; } public string Status { get; set; } } and its instantiation ...
timnavigate's user avatar
0 votes
0 answers
77 views

I want to merge two multi-level object to form a single object with no loss of data. till the level data is same no extra fields should be added, at level where fields are different new object should ...
shashank yadav's user avatar
1 vote
2 answers
81 views

I have the following datatable Col1 Col2 Col3 A B 1 A B 2 A C 1 The Col1 and Col2 is the unique key so the first and the second row is duplicated. The Col3 differ so I would like to have an option to ...
Muflix's user avatar
  • 6,896
0 votes
2 answers
261 views

I have several classes of business logic: public class Client { public string Code { get; set; } = string.Empty; public string Status { get; set; } = string.Empty; public string Account { ...
timnavigate's user avatar
0 votes
1 answer
568 views

I have a LINQ query that I am having trouble optimizing. It takes about 6 seconds to run. IList<Note> notes; data = client.Configuration.Data.OfType<UWData>() .Where(s => s....
Avinash Avi's user avatar
0 votes
2 answers
97 views

I have a list with objects such as this one: public class ReportViewModel { public string DocumentName { get; set; } = string.Empty; public DateTime? DocumentDate { get; set; } public ...
Laziale's user avatar
  • 8,305
0 votes
1 answer
66 views

have been trying for several hours to resolve the problem but i cant sos here is the tables im working with on pastebin var result = E .Join(A, a => a.ID, aa => aa.ID, ...
invis's user avatar
  • 15
1 vote
1 answer
2k views

I have a object list like below. I want to join every two rows into single row based on column B. It is sure that only two rows would be there for every single column B value. Input Output However, ...
Rahul's user avatar
  • 1,183
-1 votes
1 answer
716 views

I have below query where i am using the where clause with select and getting the result (list of librarySourceRowInputs) and would like to use the aggregate instead of (where and select). In this ...
Glory Raj's user avatar
  • 17.7k
1 vote
1 answer
671 views

I upgraded efcore 2.2 to 5 and simple group by is not working, the data is already in memory, take a look: List<IGrouping<Categories, Businesses>> businessesByCategory = location....
Offir's user avatar
  • 3,501
0 votes
3 answers
315 views

( I am a beginner with C# ) I wants to create a list of Person class using 2 lists, List of Users and List of Post here is how the class structure looks. Problem : while Creating Object using LINQ, i ...
Rohan park's user avatar
0 votes
1 answer
122 views

I have a collection of objects that I am trying to query with LINQ. Inexplicably, the code is crashing when querying for a specific value. SomeObject[] myObjects = { ... }; foreach (int id in someIDs)...
jtrohde's user avatar
  • 452
0 votes
3 answers
1k views

I have a table of doctors in my database. So I'm trying to get the list of the firstName of the doctors in my database. In the ViewModel class I'm using this code to get it public List DoctorsList () ...
DOUHADJI's user avatar
0 votes
1 answer
413 views

I am dealing with DocumentFormat.xml. I need to do work to get to the data I need for the where clause. But then I need to do the same work in the where clause to construct the desired object. This ...
Baron 's user avatar
  • 1,175
1 vote
2 answers
1k views

Can the following be done in LINQ as a one-liner, without using a for-loop? IEnumerable<MyObj> MyList = EF.GetList(etc); foreach (var row in MyList) { row.uploadedAt = MyUtils....
joedotnot's user avatar
  • 5,193
0 votes
1 answer
328 views

I have a lookup like this: ILookup<long ,float> vatPercentLookup = dataItems ?.GroupBy(x => x.VATRateId) ?.ToLookup(x => x.Key, z => z.Last().Percentage); So i want to get max ...
Iraj's user avatar
  • 1,532
0 votes
2 answers
473 views

my class, public class User { public string Username { get; set; } public string Password { get; set; ...
Doc's user avatar
  • 179
0 votes
1 answer
40 views

I can't to query a collection like this below, in order to get the maximun "value" of a given "key", but key and value are subcollection of a collection I need to get the max value of the "Revision" ...
pinale's user avatar
  • 2,254
0 votes
1 answer
176 views

Class student and the main are just for reference.. In the try catch block there are two separate s1.SNum = "string" that should each throw a separate argument but both throw the same one every time ...
Eroe's user avatar
  • 3
0 votes
0 answers
234 views

(Edit after closing: the duplicate is not a duplicate of my question, but I found my answers within an explanation of lazy evaluation.) Original question: Disclaimers: this is my 1st question here, ...
Alb's user avatar
  • 549
0 votes
3 answers
1k views

public class Account { public List<Memo1> Memos { get; set; } } public class Memo1 { public string Memo { get; set; } public DateTime AddDate { get; set; } public string UserID {...
harsha tharanga's user avatar
0 votes
1 answer
58 views

I need to fetch data based on below business requirement. We launch campaign's on items that we sell, which give the customer some discounts etc. We sell items of different brands, each brand has ...
Abdur Rahman's user avatar
-3 votes
3 answers
120 views

If I need just the maximum [or the 3 biggest items] of an array, and I do it with myArray.OrderBy(...).First() [or myArray.OrderBy(...).Take(3)], it is 20 times slower than calling myArray.Max(). Is ...
Jeno Csupor's user avatar
  • 2,939
1 vote
3 answers
653 views

I am trying to formulate a LINQ query but not a pro at it so whatever I try is not working. I would like to filter the list to get email-ids from below list where score is 0 grouped by the Team Name. ...
user1630575's user avatar
3 votes
0 answers
39 views

I'm trying to determine if there is a correct way to first filter a collection and then determine if any items in the collections pass the filter condition. The two (basic) statements I'm trying to ...
A-A-ron's user avatar
  • 579
0 votes
2 answers
943 views

I have find the code to implement a SortableBindingList that extends of BindingList and it theoretically let sort and filter a list of generic objects. It works perfectly sorting the list but I can ...
Julio Romero's user avatar
0 votes
2 answers
62 views

I would need: a list(of employee) that contains all the employees contained in all companies. (e1,e2... e9) the employee how has the oldest DischargeDate higher than 1/1/2018 I have solved it in this ...
JC M's user avatar
  • 78
0 votes
2 answers
276 views

I have comma separated Id values like this: 3,4,5,7 and this differs for each records in the table. Now from the configuration settings there are specific values like: 3,4 I need to have code that ...
user1941025's user avatar
3 votes
1 answer
3k views

Group the repetitive value in the object list using Linq query. I have the following data as table called "SudentAssessment" with these data. AssessmentId Username SITSupervisor ...
Hezron Naresh's user avatar
0 votes
2 answers
2k views

This will give me a list of my Start Dates: ( they are stored as STRING ) var startDate = myValues.Select(t => t.StartDate).ToList(); I only need it to choose the earliest date value from it. And ...
Bohn's user avatar
  • 27k
0 votes
0 answers
83 views

I have a problem which seems to be quite similar to Query objects for one to many relationship in LINQ I've been trying to solve my problem referring the above but somehow I've been failing for a ...
user3247458's user avatar
1 vote
1 answer
2k views

I'm trying to do a linq query which might have nullable params. This is my linq call listOfControlsVM = db.Controls.Where((status == null || s.Status.Description == status) && (impact == ...
Laziale's user avatar
  • 8,305
-3 votes
3 answers
1k views

I have the following LINQ query that I want to optimize. Our system is heavily dependent on this, so even slight optimization will help over all. Any ideas are welcome, not sure where to even start.. ...
scorpion5211's user avatar
  • 1,070
0 votes
3 answers
1k views

My data looks like the following image So i loaded it into a collection, using anon objects to bypass creating a class List<dynamic> myList = new List<dynamic>() { ...
joedotnot's user avatar
  • 5,193
-2 votes
1 answer
278 views

I am building a simple search tool in vb.net windows forms application with sql server database, The user will enter a unique id and will see the results which shows the status. Object Class: ...
MAF's user avatar
  • 99
0 votes
1 answer
769 views

I deserialize a JSON from a third-party provider into an object and want to query that object looking for a value in a specific property. My problem is that the object has a property (Parts) whose ...
Dani Pazos's user avatar
1 vote
1 answer
801 views

I am trying to create an extension method that will be usable for both LINQ-to-Object and LINQ-to-Entities for creating a functioning Where query. More will go into it eventually but to start I am ...
StuffOfInterest's user avatar
1 vote
2 answers
128 views

Let's say I have some MyObjects and each of them have a Description property. I have a list of keywords that I want to use to search through the MyObject list. I want to order them in descending order,...
Sweeper's user avatar
  • 292k
-1 votes
2 answers
475 views

i've got a C# web Api receiving the following object : "cars": { "bmw": true, "benz": false, "kia": true, "hyundai": false, "madza": false, "ford": ...
Silva's user avatar
  • 675
0 votes
2 answers
81 views

I was looking to find the solution to my issue, but could not find exactly what I need, so I decided to create this question: I have a list that contains objects. Those object are created based on ...
gene's user avatar
  • 2,098
0 votes
3 answers
162 views

Say we have two List<T>. The first is a list of sales totals: class SalesTotals { public Guid EmpID { get; set; } public string EmpName { get; set; } public decimal? TotalSales { ...
Scuzzlebutt's user avatar
2 votes
0 answers
120 views

as in the question I wonder if it is better performance wise to make one big Select on a list or to make several small chained selects. The second option for sure will be more readable as code is ...
Tomasz Stelągowski's user avatar

1
2 3 4 5
28