Skip to main content

All Questions

Tagged with
0 votes
2 answers
94 views

'NavigationExpandingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core in .NET Core 3.1

When I upgrade the project from .NET Core 2.2 to .NET Core 3.1, LINQ doesn't work. These are my entity models: public class Offer { public Guid Id { get; set; } public string Name { get; set; }...
Dilakshan AT's user avatar
2 votes
0 answers
39 views

I want to Perform Left Outer Join on BarcodePost

Here I want to Perform Left Outer Join on BarcodePost in LINQ I have used defaultIfEmpty() but it does not return the expected result . var result = (from data in _dbContext.MaterialInwardBarcodes ...
Farhan Patel's user avatar
1 vote
0 answers
104 views

Group By Linq Using Auto Mapper c#

Hope you all are doing well! I am working on one project inside which I have 2 models // Model - I public class Model_1 { public int Id {get;set;} public string Name {get;set;} } //Model - II ...
Rahul Parab's user avatar
2 votes
1 answer
191 views

Is it possible GroupBy with loading nested navigation properties?

In my current work project, it became necessary to query grouped data from one table of the database to display it in a table in the UI. But I'd like to load nested navigation properties in this ...
1nst4nce's user avatar
-1 votes
1 answer
219 views

Cannot implicitly convert type 'ProductOrderDto' to 'System.Collections.Generic.List<ProductOrderDto>

public class ProductOrder { public int PId { get; set; } public Product Product { get; set; } public int OId { get; set; } public Order Order { get; set; } }...
Cao Steven's user avatar
0 votes
0 answers
120 views

i need to pass Category Name with products Asp.Net Core

i have Categories Model and product Model. each product belong to categories. i need to pass the name of the Categories when product is display. i need categroies name as a title. but the Name looping ...
rona's user avatar
  • 1
0 votes
1 answer
211 views

How To Check IP with Given IP Range on LINQ C#

I've an SQL Query like WHERE Network <= @ipaddress AND LastIp >= @ipaddress and i need to convert it to LINQ Query. Network and LastIp columns are string. I'm receiving @ipaddress from input ...
fifauser's user avatar
0 votes
1 answer
257 views

IIS deployment cold query

Deployed an .net core app but encountering the first request to be slow basically 2 seconds then on second and more request it is only less than a second. I currently deployed pre compiled query, pre ...
Bon's user avatar
  • 11
0 votes
1 answer
212 views

How to apply a loop when inserting a record?

I am building a form to register assets in a database, the assets are repeated many times for that reason I created an input where I store the number of assets so that the user can enter n number of ...
Alexandra's user avatar
  • 181
1 vote
1 answer
4k views

InvalidOperationException: The LINQ expression

I'm using ef to query to databse my query is to get a date from database (string type), convert it to date type and compare it to another date var res = _context.Course.Where(a => DateTime....
Akrem Hammami's user avatar
1 vote
1 answer
72 views

Optimize linq query for .FindIndex

I have method to get index of with condition Here is code for it public async Task<int> GetJobSupplierRank(Guid? jobId, string supplierKey, UseCaseMetricsTypesEnum type, Guid? useCaseId) ...
Eugene Sukh's user avatar
  • 2,601
-2 votes
2 answers
90 views

Copy one type of List<> into another type of List<>

For some reason, i need to copy only view details from one list into another list. public class c1 { public string id{get;set;} public string firstname{get;set;} public string lastname{get;set;} ...
Vihasi's user avatar
  • 11
-1 votes
2 answers
95 views

Can I make a call to datacontext class asynchronously in C#?

Here I am trying to invoke DbContext object asynchronously from my method. Does it make any performance impact? I know that Entity Framework is not thread safe. private async Task HasPreviousRecords(...
Jinto John's user avatar
2 votes
1 answer
86 views

Is this Linq query a currect way to retrieve data or there are more effective ways?

This code works but I've heard from somewhere that when we use Select it pushes to execute Join operation. So will it considered a slow operation, or by the way is there a way/ program to check ...
T'sen Ang's user avatar
0 votes
0 answers
175 views

How to create DataTable with included entities

I use Entity Framework Core with Linq to get entities from the database, and I want to get some entities with included data and make DataTable from it. Request from DbContext looks like this: _context....
What was THAT's user avatar

15 30 50 per page
1
2 3 4 5