Skip to main content

All Questions

Tagged with
1 vote
4 answers
47 views

Apply Group by to dictionary value

I have a Dictionary which key of string type and value of list of integer type, like this: Dictionary<string, List<int>>. Lets say I add elements to it: Dictionary<string, List<int&...
sst's user avatar
  • 23
0 votes
1 answer
59 views

Reading xml into LINQ format to check against log file data - Conditions in list format - linq not picking up reformated xml

I have a project that reads xml of expected build results for each build area, and compares against build logs to see if the build passed. Right now, the linq is showing each condition in a separate ...
Michele's user avatar
  • 3,797
0 votes
1 answer
28 views

LINQ subset results grouped from multi-table join

I have 4 tables: USER: -userKey -userName ROLE: -roleKey -roleDesc PERMISSION: -permissionKey -permissionDesc USERROLEPERMISSION: -userKey -roleKey -permissionKey Here is the db query... select u....
P Fitz's user avatar
  • 3
1 vote
1 answer
61 views

Group By in Entity Framework based on condition

I have a group by clause where I am selecting key, however my problem is my key is changing based on some condition, is there any chance I can set key in one line? if (IsDefaultFund) { _summaries = (...
Sarfaraz Khan's user avatar
-1 votes
1 answer
118 views

how to use Linq groupby and where with date conditions in vb.net

I'm trying to use Linq groupby and where with date conditions in vb.net Please Guide Me. PIQ is total purchase quantity SIQ is total sales quantity BLC is total purchase quantity minus total sales ...
user avatar
0 votes
2 answers
164 views

Entity Framework Join with Group by select columns

I have 2 tables that I am trying to left join with a linq query I want to left join 2 tables, i want to group multiple columns but I want to select specific columns and use datepart etc on some of the ...
Brian's user avatar
  • 63
0 votes
0 answers
136 views

EF Core + Net Core 8 RC2 : GroupBy in a subquery gave an exception on ToList()

This query was working in EF6: var FamillesNonSaisies = db.CaracsIndivAffichees .GroupBy(ci => ci.FamilleCarac).Select(g => new { Famille = g.Key.Intitule, Ordre = g....
Julien's user avatar
  • 1
0 votes
0 answers
17 views

How to write Linq for group by time period and count calculation by this period

The following model contains the name of the airport and the dates of arrival flights: public class FlightStatisticsModel { /// <summary> /// Airport name /// </summary> ...
user6408649's user avatar
  • 1,297
0 votes
1 answer
314 views

LinqToDB.LinqToDBException error in group by linq query in nopcommerce

Here is my group by query var query = ( from fee in _walletRepository.Table group fee by fee.PartyId into groupResult select new { partyId = groupResult.Select(x => x....
s.k.Soni's user avatar
  • 1,220
0 votes
1 answer
93 views

Adding a dynamic GroupBy expression to an IQueryable

I want to pass a dynamic GroupBy expression into an IQueryable. I'm already doing something similar with a Where clause that is working OK. The purpose of the group by is then to allow my to extract ...
Mark Cooper's user avatar
  • 6,844
1 vote
2 answers
51 views

C# Grouping by calculated values isn't working

Why isn't this grouping correctly? I'm grouping by day of week and day of month, and I end up with four results, not three. query.GroupBy(datapoint => { var timeDimensionValue = (DateTime)...
Steve Andrews's user avatar
0 votes
1 answer
37 views

.First()' could not be translated in EFCore 3 [duplicate]

Is there a decent work around to using .First() in Group By queries on Linq using EF Core 3.1? Here is an example of a query reading from SQL var test = from r in dc.Role join f in ...
Cameron Castillo's user avatar
-1 votes
3 answers
89 views

LINQ Group by doesn't return the result as expected

I have an animal class: public class Animals { public string Type { get; set; } public string Gender { get; set; } public int Amount { get; set; } } and a class Cost for the cost ...
Cenderze's user avatar
  • 1,202
1 vote
2 answers
82 views

EF Core GroupBy-Sum LINQ generating Unexpected SQL

I have the following LINQ query: var data = await _context.Answers .Where(q => q.Question != null) .GroupBy(q => q.Choice) .Select(g => new { g.Key, Data = g....
Prathamesh Katkar's user avatar
0 votes
1 answer
47 views

c# linq Query on datatable groupby having count

I have a datatable and I need to perform the following query on it (sql): SELECT C1, C2, C3, count(*) FROM MyTable group by C1, C2, C3 having COUNT (*) > 1 Can you point me to some code, in order ...
user1238784's user avatar
  • 2,410

15 30 50 per page
1
2 3 4 5
80