All Questions
9,744
questions
0
votes
1
answer
57
views
Pagination on the result from multiple collection .net
I am trying to add offset pagination( input is pagesize and limit) on combined result which is aggregating multiple collections. Earlier I had only limit on the reponse. Below is the code for the API ...
1
vote
1
answer
50
views
How to delete the rows of datatable1 having different ID while compare with the datatable2
Given the first data table having master data and the second table having the needed data IDs, I need to delete the rows from the first table which are not present in the 2nd table. I am trying to use ...
0
votes
0
answers
28
views
Use some kind of helper function In EF Select query to make subquery [duplicate]
I have several tables that handles different kinds of translations for my entities and those tables to linked via relations to other entities.
I use subquery to directly access translations tables ...
0
votes
0
answers
30
views
Search implemented using LinqKit predicateBuilder working fine in the local but not working in the dev build
I have implemented a search functionality using the LinqKit predicate builder. It is working fine in the local environment and when it is published to a folder the same functionality is not working. ...
0
votes
1
answer
52
views
Why does adding .AsQueryable() and .AsNoTracking() seem to work for filtering related entities in Entity Framework Core? [closed]
I need to filter related entities while including them in the query.
Each Order has a Customer, and multiple OrderItems, and each OrderItem has a Product. I want to include OrderItems that either ...
0
votes
0
answers
92
views
Dynamic LINQ sorting after grouping
We wrote a generic filterable repository in .NET 8 that should be able to accept a list of filters and a list of sorts, and apply them to any given entity.
Due to some business logic, we have a Task ...
2
votes
2
answers
82
views
How can I reuse the logic in a .Include.Where() call while working with Entity Framework Core in .NET?
I am writing a database query using LINQ in .NET and I want to be able to not duplicate the code I put in my Where method calls.
I want to return Blogs that have fresh Comments, and want to filter ...
0
votes
1
answer
55
views
EF Core 8 : single value objects. Error on linq
In EF Core 8, I'm trying to do this query (Active is a simple value object of type bool):
return await _dbSet
.Where(e => e.Active.Value)
.ToListAsync();
And I get:
...
0
votes
0
answers
56
views
Translate expression bodied member to SQL so it can be used in LINQ where clauses?
Is it possible to write an extension to EF Core that tells it how to translate expression bodied members (or methods) to SQL so a getter/method can be used in where-clauses?
What I would like to ...
0
votes
2
answers
60
views
linq join two datatables
I am trying to join two datatables with linq
The query is
out_dt = (From row1 in dt1, row2 in dt2
where row1("id").ToString = row2("id").ToString
Select row1).CopyToDatatable
...
-1
votes
1
answer
114
views
List used as a queue in .net and retain order [duplicate]
I want to use a List as a queue. This is because List is more flexible when getting/inserting data.
My question is when I use Linq operations (DistinctBy, Take) as shown below, do I still get the ...
0
votes
1
answer
43
views
Unable To Change TextBox Value
I am passing value from one form to another and the value from second form is from DataGridView. I can see it passes data perfectly when debugging in the first form and did as follows:
public Form1()
{...
1
vote
1
answer
122
views
How to eliminate nested joins in generated SQL query?
I created a LINQ query in a .NET Core Application to retrieve some data. When checking the generated SQL for the LINQ I noticed nested queries in it. I want to optimize my LINQ query by removing the ...
0
votes
2
answers
80
views
Linq how can do null check in where clause?
This is simple linq query
datetime dob = "05152024";
var query = from row in maxLookupData.AsEnumerable()
where row.Field<DateTime>("bar")) <= dob
select row;
In ...
0
votes
3
answers
137
views
Invalid LINQ Expression ... could not be translated
I don't know why, when I execute this LINQ request, this exception is returned :
System.InvalidOperationException: The LINQ expression '__ids_0
.Contains(StructuralTypeShaperExpression:
Patron....