All Questions
Tagged with linq asp.net-core
975
questions
0
votes
2
answers
55
views
How to join tables and group the results using LINQ?
I have a table of Products and a table of Product_Images with a one to many relation (one product can have multiple images) and I am trying to retrieve all products with their related images. So far I ...
0
votes
3
answers
79
views
Sequence contains no elements in LINQ
In the code shown here, I am getting an error in LINQ:
Sequence contains no elements
When the reason column contains data, it is throwing this exception. Please suggest how to handle this exception.
...
0
votes
3
answers
58
views
Entity Framework C# join with one column only from second table
I have a join in Entity Framework connecting the Order and the OrderItem tables. All orders will have multiple order items. I'm trying to return all the orders, but only the orderItemStatus column ...
0
votes
0
answers
78
views
Linq query DateOnly fields returning results on comparing dates
I have this linq query request as:
var test = (...
where ...
&& test.SL.Any(line =>
line.ServiceCode == serviceCode
...
1
vote
1
answer
89
views
EF Core : retrieve products with all supplier prices for price comparison and identify cheapest supplier
I'm working on an ASP.NET Core application using ABP framework and EF Core. I need to retrieve information about products and their suppliers for comparison purposes.
Specifically, I want to achieve ...
0
votes
1
answer
46
views
Fetch the Name based diff version for same Service and Function
Here is my Json object .
[
{
"Id": 1,
"Name": "Asset A",
"Version": 1,
"Function": "Song",
"Service": "Song"
...
0
votes
1
answer
68
views
ASP.NET Core / EF Core / Mysql - how to group by week?
I'm new to ASP.NET Core and working on a project where I need to group data by week using Entity Framework Core (EF Core) with a MySQL database. However, I'm encountering an issue with the grouping.
...
0
votes
0
answers
45
views
Mapping Functions EF Core to SQL [duplicate]
I'm looking for a more efficient way to grab my objects from the database and map them DTOs while using reusable methods.
Here are my database classes:
public class Sign
{
public int Id { get; set;...
0
votes
0
answers
33
views
Mongo Aggregation Query to Sort Nested Data
I want to sort nested array in MongoDb with c# driver. But there is not much i could do. I have a BuildFilter() method that does the filter and i had come to solution using Linq but it is lot slower ...
0
votes
2
answers
60
views
How to select and group fields using LINQ?
I want to know how l can group rows in my table using LINQ. The below code successfully loaded my grid with data from the database, so my requirement is to select and group them into store and item.
[...
0
votes
2
answers
48
views
Linq query filtering null values last in asp net core mvc
I have a table in db name Guest as follows:
Guest1 Guest2 Guest3 Guest4
James
Tom
Jerry Steve Jones
Chris Luke
Pet Ron Rob James
I want the desirable table below such that ...
0
votes
0
answers
77
views
Data is Null. This method or property cannot be called on Null values in .Net core API
I need to get all the columns from my CourseDto class, here is my code:
public async Task<IEnumerable<TrendingCourseDto>> GetTrendingCoursesAsync()
{
var trendingCourses = await ...
1
vote
1
answer
53
views
System.InvalidOperationException: 'The ConnectionString property has not been initialized.' in ASP.NET Core 8, Entity Framework and Linq
I am using ASP.NET Core 8, Entity Framework and Linq to connect to a SQL Server database, but I am getting this error
System.InvalidOperationException: the ConnectionString property has not been ...
1
vote
2
answers
110
views
SqlException for datetime column
I have the following LINQ query :
var studentRecords = context.Students
.Include(i => i.StudentsAdmission)
.Where(w => !w....
0
votes
1
answer
94
views
LINQ could not be translated. Call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'
How can I compare a list sent to me for filtering with a list in my database?
I have a List called CandidateLanguage in my candidate entity.
And I get a list called LanguageSkills from outside to ...