Category "ienumerable"

How does the behavior of .Take() changes based on the interface reference I'm using on left. IQueryable vs IEnumerable

Assume I've these sample codes IQueryable<Employee> data = context.Employees.Where(x => x.FullName != "Shekar Reddy"); var topE

Performance between Iterating through IEnumerable<T> and List<T>

Today, I faced a problem with performance while iterating through a list of items. After done some diagnostic, I finally figured out the reason which slowed dow

Why can't I assign List<int> to IEnumerable<object> in .NET 4.0

I try to do this: IEnumerable<object> ids = new List<string>() { "0001", "0002", "0003" }; it works great! But when I try to do this: IEnumerab

Return SqlDataReader with closed connection

I have created a Sql helper class which handles most of my needs. Amongst those, I have a function which executes a SQL statement and returns a SqlDataReader a

IEnumerable vs List - What to Use? How do they work?

I have some doubts over how Enumerators work, and LINQ. Consider these two simple selects: List<Animal> sel = (from animal in Animals

Union two list by property

I would like to merge two list without duplicates. It should distinct only by one property. I have a class: public class Test { public int Id { get; set;

How can I return an empty IEnumerable?

Given the following code and the suggestions given in this question, I've decided to modify this original method and ask if there are any values in the IEnumara