I have the following code and it works well:
var _data = (from qu in _que.GetAll( u => u.company == "GE" ) select new { qu.name, qu.address });
Signature of the GetALL Method
ICollection<T> GetAll(Expression<Func<T, bool>> predicate);
Now I need to enclose the above in some block so that it becomes:
{ var _data = (from qu in _que.GetAll( u => u.company == "GE" ) select new { qu.name, qu.address }); } var _abc = _data; <<< doesn't work now
Once I do this, _data becomes local, and I cannot access it from outside the block. I assume that I need to make the _data declaration outside the block. But what I declare is this too, as they print the return and put in _data, is an anonymous type. Is there a way that I can declare _data without having to modify the query or make up some type of return value?
source share