I am wondering what the difference between IQueryable, List, IEnumerator is and when I should use each one? For instance when using Linq to SQL I would do some
I have the following recordset for a given School (i.e., ABC in this example) , I need to groupby on Class and Activity and take the first row . Then I need to
I got a linq lambda select code that works before I added the Select index overload. Before, I got the list of records but I need the index which I use to assig
I'm trying implement the follow query in LINQ, but I don't find solution: SQL: SELECT COUNT(*) AS AmountMonths FROM (SELECT SUBSTRING(CONVERT(NVARCHAR(12), pay_
Net core application. I have below query in my application var result = sourceProposal.Quotes .Where(x=>x.QuotationId == sourceQuoteId) .FirstO
Considering I have 2 list (firstList and secondList), both with same properties, but with diffent values. I need the result merge both lists, but it must consi
I have a table like Date Balance A Balance B --------------------------------- 2022.03.01 100 200 2022.03.01 200 500 2022.03.02 300
The raw SQL uses correlated subquery for single table, any possibility to translate this with single LINQ Query? SELECT * From dbo.Products AS P1 WHERE SalePric
I have a data set (ex. 1, 1, 4, 6, 3, 3, 1, 2, 2, 2, 6, 6, 6, 7) and I want to group items of the same value but only if they are next to each other minimum 3 t
I have this code: IQueryable<WinnerClassExtend> dataList = from Class in _context.AllClass join Winner in _context.AllWinners on Class.ClassId equals Win
Net application. I have one entity with child entities. I have to filter based on child entity values. For example in the below query, var sourceProposal = pro
Simple scenario : var d = new Dictionary<int, List<int>>(); Dictionary<int, IEnumerable<int>> d2 = d.ToDictionary( kv => kv.Key,
I have an IEnumerable with fields Name(string) and Amount(ulong). I want to get a single LINQ query to group those elements by Name and then get their sum and a
I have list say list of customers and inside each list there is another list of orders Class Customer { int ID, string Name List<Order> orders } Class Or
I am working on .NET CORE 6 application along with Entity Framework CORE 7. I have class where I have written LINQ script. This is async method. I am not sure w
I would like the loop to start from the second element and to end before the last one. So that I can set the first and last one to constant value. for (int i =
I'm trying to improve the efficiency of this method and I can't figure out why my "solution" is throwing an error. Here's the existing and working, albeit slow,
I've been reading lately articles and documentation about deferred execution, LINQ, querying in general etc. and the phrase "object is enumerated" came up quite
I have a Linq query which is selecting 2 columns(that can be any 2 from all columns) dynamically based on some condition.I need to map the query result in to be
Global query filters are very handy when implementing tenant and soft deletion features. But my problem is is that when i write a query with joins, for instance