All Questions
150 questions
-1
votes
2
answers
294
views
'System.InvalidOperationException' in System.Linq.dll (Sequence contains no elements)
Getting the following exception in the code below and cannot figure out how to solve for it:
Exception thrown: 'System.InvalidOperationException' in System.Linq.dll
Sequence contains no elements
...
0
votes
2
answers
118
views
Entity Framework Core subquery: Error System.InvalidOperationException : Nullable object must have a value in
I have the following method in the entity framework (It has less properties for simplicity but the important thing is there):
public async Task<TemplateDetailsDto?> SearchDetailsAsync(...
-3
votes
1
answer
551
views
System.InvalidOperationException: 'sequence contains no elements' [closed]
I am trying to login with the help of username and password but it is giving me above error
enter image description here
0
votes
0
answers
42
views
Not able to apply filter through common search box on geometry type on IQueryable object
This is my detailed code (https://i.sstatic.net/h8nBV.png)
could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a ...
3
votes
2
answers
180
views
Exception is lost while consuming a PLINQ query
I observed a weird behavior while experimenting with a PLINQ query. Here is the scenario:
There is a source IEnumerable<int> sequence that contains the two items 1 and 2.
A Parallel LINQ Select ...
0
votes
0
answers
110
views
Exception thrown when retrieving data from database when grouping
I'm trying to retrieve accounting periods from a MySql database using entity framework but keep running into an InvalidCastException exception.
This is the linq statement below:
var periodList = (from ...
4
votes
4
answers
2k
views
How to chunkify an IEnumerable<T>, without losing/discarding items in case of failure?
I have a producer-consumer scenario where the producer is an enumerable sequence of items (IEnumerable<Item>). I want to process these items in chunks/batches of 10 items each. So I decided to ...
1
vote
0
answers
62
views
TakeWhile filtering on <IEnumerable<IGrouping>> returns InvalidCastException
I have a private IEnumerable<IGrouping<string MyClass>> myGrouping;
And I am doing this with it:
foreach (IGrouping<string, MyClass> filteredGrouping in myGrouping.Select(x => x....
0
votes
2
answers
100
views
How to use TryCatch Statement in ToDictionary C#?
I have a dictionary of asyncronous call . The problem is sometimes these asyncronous call will throw an exception but I am not entirely sure how to handle them . The GetUserLicenseTypes returns a list ...
0
votes
1
answer
280
views
Linq "where" condition with nullable object property result in "invoke non static method requires a target"
I've tried to find a similar question but I haven't found exactly what I want.
I have this issue: about the following code I am not able to find a way to manage that if devTab is null then his ...
-1
votes
1
answer
94
views
voa_class related exception while browsing through objects in DB, using Telerik libraries
Edit2: this question started as a question on how to browse through tables, but it turned into a question about Telerik voa_class exception
Edit1: this question contains two ways of trying to do the ...
0
votes
1
answer
82
views
ASP.NET MVC Controller won't catch exceptions from LINQ lambda
I have a bog-standard MVC Controller with a try/catch around the code to be able to return some custom data if an exception occurs. This works just fine for exceptions thrown directly in the ...
1
vote
2
answers
154
views
Invalid Cast Exception for Linq JOIN on Strongly typed Dataset Tables
Have browsed a few similar questions, but couldn't apply them to this. I'm performing a Linq query on a strongly typed dataset:
query = From g In dbDS.gi_game
Join o In dbDS.gi_organisation
...
2
votes
2
answers
858
views
Using Async/Await in Linq expression does not throw exception
Evening,
Can anyone point me to documentation for why the linq statement using an async and await operators will not propagate an exception up the stack but the foreach loop will? There has to be ...
0
votes
0
answers
76
views
OutOfMemory Exception from LINQ statement only under certain cirumstances
I manage a website with a blogging section consisting of ASP.NET MVC architecture with articles stored in a SQL Server database. It is set up to email me if any exceptions are thrown. Every couple ...