tags:

views:

328

answers:

2

How do I Convert a System.Collections.Generic.List<T> to a System.Data.Linq.EntitySet<T> ?

+2  A: 
var list = new List<string> 
{ 
    "element1", "element2" 
};
var entitySet = new EntitySet<string>();
entitySet.AddRange(list);
Darin Dimitrov
Thanks for ur answer. It did work
Johnny
+2  A: 

Don't think you can convert a List<T> to an EntitySet<T> but you can put the content of your list in the entitySet.

var list = new List<string> { "a", "b", "c" };
var entitySet = new EntitySet<string>();
entitySet.AddRange(list);
madgnome
Thanks for ur answer. It did work
Johnny