generic-list Questions

2

I have a ServiceContract, using System.Collections.Generic; using System.ServiceModel; namespace MainModule.Sub.Communication { [ServiceContract] public interface IWebMethod { [OperationContra...
Guinea asked 31/12, 2012 at 11:53

2

I am a beginner in programming, please go easy on me and I am finding difficult to get the answer for my question. I can't get my head around the complex codes. Can some one please explain me with ...
Elwandaelwee asked 18/12, 2012 at 5:49

3

Solved

I'm wondering whether it will be quicker to follow one pattern or another for constructing a unique list of objects in C#: Option 1 Add all the items into a generic list Call the list.Distinct f...
Pyrazole asked 7/12, 2012 at 17:9

4

Solved

I'm working on a reflection project, and now I'm stuck. If I have an object of myclass that can hold a List<SomeClass>, does anyone know how to get the type as in the code below if the...
Electromotor asked 25/6, 2009 at 12:57

9

Solved

I have data in a DataReader which I want to be converted to a List<T>. What is a possible simple solution for this? For e.g. in CustomerEntity class, I have CustomerId and CustomerName...
Odoacer asked 23/9, 2009 at 9:14

1

Solved

Similar question have been asked here but none fits to my need. I made test cases to see which is faster. But I feel my linq code is still slow. How do I construct the linq code for faster performa...
Allurement asked 25/10, 2012 at 5:58

5

How can i sort myScriptCellsCount.MyCellsCharactersCount (list int type) in linq public class MyExcelSheetsCells { public List<int> MyCellsCharactersCount { get; set; } public MyExcel...
Liv asked 17/6, 2010 at 14:10

3

Solved

I'm having trouble converting a list object back to its original type without an explicit cast. My intention is to generalize methods so I could pass in different db Types such as Person or Company...
Flyblown asked 14/8, 2012 at 14:46

8

Solved

I tried the following code in LINQPad and got the results given below: List<string> listFromSplit = new List<string>("a, b".Split(",".ToCharArray())).Dump(); listFromSplit.ForEach(dele...
Wagram asked 15/10, 2008 at 16:0

1

Solved

Perhaps I am missing something trivial. I have a couple of List<T>s and I need one big list from them which is a union of all the other lists. But I do want their references in that big list ...
Foggy asked 28/7, 2012 at 22:25

4

Solved

I have a class Team that holds a generic list: [DataContract(Name = "TeamDTO", IsReference = true)] public class Team { [DataMember] private IList<Person> members = new List<Person>(...
Undertook asked 1/4, 2010 at 16:49

3

Solved

I am trying to bind a generic list like List Parents to a ComboBox. public Form1() { InitializeComponent(); List<Parent> parents = new List<Parent>(); Parent p = new Parent(); p....
King asked 15/4, 2011 at 17:34

1

Solved

I'm trying to add items to a dropdown list using a List of ListItems, but it's not picking up the value (only the text). The code is below (simplified from the code I'm actually using): Position...
Disremember asked 21/3, 2012 at 15:2

3

Solved

I am writing an address book program. I have each person's details stored in a List<Person>. I need to be able to sort this list by last name (using first name if there are ties) or by post c...
Defray asked 21/3, 2012 at 11:34

1

Solved

I need to use a list monad transformer. I've read that there are potential problems with ListT IO from Control.Monad.List, since IO isn't commutative, so I'm looking at ListT done right. But I'm ge...
Intemperance asked 15/3, 2012 at 18:34

3

Solved

Possible Duplicate: How do I clone a generic list in C#? List<MyObject> a1 = new List<MyObject>(); var new1 = a1; Now if I change a1 then new1 is going to be changed as...
Anthropomorphic asked 8/3, 2012 at 17:41

3

Solved

I am trying to find a generic way to assign values to a property dictated by a lambda expression, look at the example code below, how would the signature for the ConverToEntities method look and ho...
Patchouli asked 14/2, 2012 at 1:29

1

Solved

Consider the following code example: TempList.ForEach(Function(obj) obj.Deleted = True End Function) And this one: TempList.ForEach(Function(obj) obj.Deleted = True) I would expect the re...
Liris asked 17/1, 2012 at 16:11

1

Solved

i got a class which holds info about pictures, like filepath, hashvalue, bytes. in another class i got a generic list where i put objects from the class that holds picture info. that class looks l...
Marcusmarcy asked 1/11, 2011 at 8:56

3

Solved

How can i pass a list which is a list of DerivedObjects where the Method is expecting a list of BaseObjects. I am converting the list .ToList<BaseClass>() and am wondering if there is a bette...
Incisor asked 4/10, 2011 at 4:12

4

My Code looks like this : Collection<NameValueCollection> optionInfoCollection = .... List<NameValueCollection> optionInfoList = new List<NameValueCollection>(); optionInfoList =...
Uttasta asked 3/3, 2009 at 5:20

1

Solved

In C# I have been performing a FindAll in a generic list as follows: List<group.category> tlist = list.FindAll(p => p.parid == titem.catid); Two questions, is this the appropriate way o...
Pacific asked 1/9, 2011 at 23:18

3

Solved

I have this generic list and I want to get the byte size of the type like if T is string or int etc., I tried both ways as written in getByteSize(), and just to let you know I am using only one way...
Iyar asked 31/8, 2011 at 10:56

1

Solved

I have a question which is similar to some questions at stackoverflow but none really answer my problem. I use the ObjectMapper of Jackson and want to parse this JSON string into an List of User ob...
Shillelagh asked 12/8, 2011 at 12:45

1

Solved

I have two Generic Lists containing different types, for the sake of example, lets call them Products and Employees. I'm trying to find Products that are based at the same location as Employees, i....
Bonze asked 26/7, 2011 at 9:6

© 2022 - 2024 — McMap. All rights reserved.