20
Reply

Create List accessible for other classes

Jay S

Jay S

May 2 2013 11:03 AM
1.5k
I currently am making a list like this in a winform:

var NationEligable = 
(from p in playerPeople
orderby p.NationClubContracted
where p.NationClubContracted!= -1 
group p by new { p.NationalityName,p.NationClubContracted } 
into mygroup
select new
{
mygroup.First().NationalityName
,NationCallUp =  mygroup.First().NationClubContracted
}).ToList();

i know this is a "anonymous type" but need to be able to access the list across classes/other forms in my projects.

I don't mind if it needs to get re-written from linq/lambda or whatever..

Basically need the list accessible across other classes/form in my project to populate comboboxes.

Any help would be appreciated.


Answers (20)