ilist Questions

4

Solved

What is the most efficient way to remove multiple items from an IList<T> object. Suppose I have an IEnumerable<T> of all the items I want to remove, in the same order of occurrence that...
Douceur asked 2/8, 2013 at 23:23

8

Solved

See the definition of System.Array class public abstract class Array : IList, ... Theoretically, I should be able to write this bit and be happy int[] list = new int[] {}; IList iList = (IList)...
Recognition asked 11/5, 2011 at 18:15

4

Solved

List.AddRange() exists, but IList.AddRange() doesn't. This strikes me as odd. What's the reason behind this?
Ventail asked 18/7, 2012 at 9:27

6

Solved

If a method takes a parameter of type System.Collections.IList can I legitimately/safely pass a value of type System.Collections.Generic.IEnumerable<T>? I would appreciate a thorough explan...
Tertius asked 4/1, 2010 at 16:7

2

Solved

I have a function that returns an IList< T > and is the DataSource for a DataGridView. I learned that DataGridView won't sort IList. I read This stackoverflow Q&A and am trying to implement ...
Stutter asked 14/5, 2014 at 17:22

5

Solved

I am returning IList from Business layer. But in viewmodel I have to use Find function. One method is to convert IList to List. But is there anyway to add "Find" method to IList
Nicodemus asked 14/11, 2010 at 2:59

6

Solved

There's no Sort() function for IList. Can someoene help me with this? I want to sort my own IList. Suppose this is my IList: public class MyObject() { public int number { get; set; } public st...
Prickly asked 2/10, 2010 at 5:6

5

Solved

I have a the following dictionary: IDictionary<int, IList<MyClass>> myDictionary and I am wanting to get all the values in the dictionary as an IList.... Just to add a bit of a b...
Pitarys asked 17/2, 2009 at 7:1

9

Solved

I am trying to cast IList type to List type but I am getting error every time. List<SubProduct> subProducts= Model.subproduct; Model.subproduct returns IList<SubProduct>.
Postfree asked 5/2, 2010 at 13:6

15

Solved

So I came across an interesting problem today. We have a WCF web service that returns an IList. Not really a big deal until I wanted to sort it. Turns out the IList interface doesn't have a sort m...
Cedeno asked 19/8, 2008 at 1:23

4

Solved

I want to convert IList to array: Please see my code: IList list = new ArrayList(); list.Add(1); Array array = new Array[list.Count]; list.CopyTo(array, 0); Why I get System.InvalidCastException...
Recuperative asked 29/2, 2012 at 21:35

6

Solved

I am new to generics. I want to implement my own collection by deriving it from IList<T> interface. Can you please provide me some link to a class that implements IList<T> interface or...
Jollenta asked 24/7, 2009 at 8:33

4

Solved

Our Client's database returns a set of prices in an array, but they sometimes don't include all prices, i.e., they have missing elements in their array. We return what we find as an IList, which wo...
Waldner asked 1/6, 2010 at 4:23

6

Solved

What is the correct syntax for this: IList<string> names = "Tom,Scott,Bob".Split(',').ToList<string>().Reverse(); What am I messing up? What does TSource mean?
Snakebite asked 24/11, 2008 at 20:30

2

Solved

I have the following classes: Client ClientCacheMedia ( contains Client, Media and some other parameters so it is the link between the media and the client) Media where client contains an IList...
Norward asked 1/6, 2010 at 11:28

3

Solved

I have this mapping defined in my Application Layer: public IList<ProfessionDTO> GetAllProfessions() { IList<Profession> professions = _professionRepository.GetAll(); Mapper.CreateMa...
Gingergingerbread asked 17/1, 2012 at 10:52

2

Solved

I'm doing the synchronization between the two lists. IList<Event> GoogleEvents and Table<myEvent> DB.Events; On google side i'm using this String Summary, String Description, EventDa...
Loathly asked 10/7, 2014 at 8:31

1

Solved

Why is IList defined like this? public interface IList<T> : ICollection<T>, IEnumerable<T>, IEnumerable public interface ICollection<T> : IEnumerable<T>, IEnum...
Ultraism asked 20/3, 2015 at 6:44

1

Solved

I've always preferred to use IEnumerable instead of List, for obvious reasons, where applicable. In the current project, I've bumped into IList and after I've g'ed it, the Internet told me that the...
Bibliomancy asked 14/8, 2014 at 7:54

2

Solved

I am having trouble with the code below. I want my method to take an IList, not a List But am I misguided? Here is my method: public void DoFoo( ref IList<Foo> thingy) {} Here is the decl...
Eddington asked 25/7, 2014 at 15:18

3

I have a list that stores well over a million objects within it. I need to look through the list and update the objects found through the below query as efficiently as possible. I was thinking of ...
Doubly asked 9/12, 2013 at 3:40

6

Solved

I'm facing a problem adding data to an IList but the problem is each time I added data the existing data is overwritten with the current one my code is given below: Test test = new Test(); I...
Pycnidium asked 3/10, 2013 at 10:18

4

I am making a library which is going to be used widely by different applications. You can say that it is sort of a public library or SDK. Currently I am working on a function which takes a list of...
Whalebone asked 12/9, 2013 at 7:44

3

How to use LINQ to remove certain elements from a IList based on another IList. I need to remove records from list1 where ID is present in list2. Below is the code sample, class DTO { Prop...
Disclosure asked 17/5, 2013 at 9:58

1

Solved

I'm trying to create a method which returns a list of whichever type the user wants. To do this I'm using generics, which I'm not too familiar with so this question may be obvious. The problem is t...
Timms asked 24/3, 2013 at 20:13

© 2022 - 2024 — McMap. All rights reserved.