How to use the result of this LINQ in another method and get the CountryID
and count
properties?
public IQueryable GetRequestsByRegion(string RequestType) { try { var q = from re in context.RequestExtensions from r in context.Requests where re.ExtensionID == r.ExtraInfoID && r.OriginalRequestID == null && r.RequestType == RequestType group re by new { CountryID = re.CountryID } into grouped select new { CountryID = (int)grouped.Key.CountryID, count = (int)grouped.Count(t => t.CountryID != null) } ; return q; } catch (Exception ex) { } return null; } public void GetAllInformationRequestsByRegion() { IQueryable dict = GetRequestsByRegion("tab8elem1"); }
Inverse types and variable types do not have to be specified ... It was my attempt. I also use WCF, so I cannot return object types.
source share