I have a class like this
public class foo
{
private void getThread()
{
var AllThreads = from sc in db.ScreenCycles
join s in db.Screens on sc.ScreenID equals s.ScreenID
select s;
}
}
I want to make the AllThreads variable a class variable instead of a method variable. Like this...
public class foo
{
var AllThreads;
private void getThread()
{
AllThreads = from sc in db.ScreenCycles
join s in db.Screens on sc.ScreenID equals s.ScreenID
select s;
}
}
How ever it wont let me declare a class variable of type var.
How to I achieve this?