Tagged Questions
0
votes
0answers
42 views
Linq group of chains
This is my collection
var list1 = new List<string> { "aa", "bb", "cc", "dd", "ee" }
.Select(x => new Pair { PropName = x, TypeName = x + "Prop1" })
...
0
votes
1answer
21 views
Linq - group by a name, but still get the id
I'm trying to find duplicates in linq by a particular column (the name column), but I also wish to return the unique id, as I wish to bind to the ID to display additional information about the row.
...
4
votes
3answers
1k views
Group Number in a LINQ Group by Query
I've been using 101 LINQ Samples to get my feet wet using LINQ. It's been a good first resource, but I can't see an example there of what I currently need.
I just need to associate a sequential group ...
43
votes
1answer
34k views
Group by in LINQ
Let's suppose if we have a class like
class Person {
internal int PersonID;
internal string car ;
}
Now I have a list of this class:
List<Person> persons;
...
1
vote
3answers
33 views
LINQ Splitting and group by resulting property
I have an object and one of the properties of the object is a comma delimited list of names e.g.
IList<Audits> auditData = new List<Audits>();
auditData.Add(new Audit
{
...
1
vote
2answers
39 views
DataTable group by seperated by comma
i have a datatable that looks like the following
cname tname text allowgroupping
A M good Yes
A M bad Yes
A M ugly Yes
B N sick ...
3
votes
1answer
43 views
LINQ GroupBy on object with several levels
I've got some classes declared like this:
public class UserSpend
{
public string UserName{ get; set; }
public MonthSpend[] Spend { get; set; }
}
public class MonthSpend
{
public ...
0
votes
2answers
61 views
Group by string occurence using linq
Googling brought up nothing helpful, so I'm asking here: How to group a string by occurence of a certain string?
Example data of a petting zoo
Name: My little petting zoo CRLF
...
0
votes
1answer
48 views
Flatten data in linq
I have a linq query where I need to do groupings to only select highest test date within a certain month based on testTypeId, testTakerId, subAreaId, subjectName, testDate.Value.Month, ...
0
votes
1answer
30 views
Use linq to group by array element
I have data in the following structure which I need to group by Id and Date. Date is a field on an array. I need to sum the amounts for each date grouped by Id at the top level, is this possible with ...
1
vote
2answers
73 views
Manipulate data on list with date period grouping by date/month
I have a list of Sales of services for specific time period (activationDate through endDate). I need to generate a sell report grouping by month-year (Eg April 2012). For each month I'd like to show ...
1
vote
1answer
74 views
Multi Column Group By Expression Tree
As per the post LINQ Expression of the Reference Property
I have implemented Group By Extension thanks to Daniel Hilgarth for the help , I need help to extend this for GroupByMany as below
...
0
votes
1answer
67 views
LINQ Expression of the Reference Property
I want to get the LINQ Expression of the Reference Property
I need to get the Lamda Expression as groupCol=>groupCol.Role.Name
I have tried with the expression but not succeeded , this will work ...
4
votes
5answers
75 views
LINQ Grouping dynamically
I have a class list of records, so user can select to group rows dynamically by property name. For example MenuText, RoleName or ActionName. Then I have to execute grouping so I need a generic method ...
20
votes
1answer
25k views
Linq with group by having count
how do I write this query in linq (vb.net)?
select B.Name
from Company B
group by B.Name
having COUNT(1) > 1