Questions tagged as 'enumerable'

3
answers

What's the difference between IEnumerable, IQueryable and List?

What is the difference between IEnumerable , IQueryable and List in .NET? When is it better to use one or the other? Why does ReSharper suggest changing the return of this function, for example, from List<T> : private Li...
asked by 27.05.2014 / 18:50
2
answers

Warning: "Possible multiple enumeration of IEnumerable"

I was doing some operations where I make use of collections. In one of these I needed to get a range (% w / o%) of numbers and did the following: var range = Enumerable.Range(0, 4); And then I tried to do something like var primeiro = ra...
asked by 25.11.2015 / 12:55
1
answer

Why Arrays implements IEnumerable but does not implement IEnumerableT?

I was making a class that contains an Array of class Episode : public Episode[] EpisodesList; Then I implemented IEnumerable<T> in my class. And as expected, I implemented the method GetEnumerator() ... p...
asked by 15.04.2015 / 06:57
2
answers

EntityFramework .AsEnumerable () or .ToList ()?

In one of the projects I got I saw the following code, which implements a data-listing method of a given entity, but this listing is read-only: /// <summary> /// Listar todas entidades /// </summary> /// <returns></returns...
asked by 03.08.2016 / 20:23
2
answers

What is IEnumerable and IEnumerator?

I've done a combo of questions about IEnumerable and IEnumerator to not only help me but everyone who needs a more didactic explanation. Question 1    Someone could explain in a more didactic way what these   interfaces and...
asked by 21.03.2017 / 17:24
1
answer

Yield does not return data

When executing the method call, an Enumerable of HTML components should be returned. I'm using the HTML Agility Pack to read an HTML file. The same method works as expected by removing yield and manually adding to a list HtmlNo...
asked by 02.11.2014 / 01:51
1
answer

C # How to rename MANY files faster or at the same time?

So, I'm creating a program here to rename files, the code I've made is very slow and only renames one file at a time, and can not create a code to rename all at once because they are distinct numbers and not is in sequence which might make it eas...
asked by 23.05.2017 / 01:52
2
answers

Why does .all in an empty list return true?

I was having an error in a business rule, and by investigating, I came up with the following code snippet, which is intended to check if all processes in a list are active: return processos.All(proc => proc.Ativo) When debugging,...
asked by 12.07.2018 / 20:26