LinqToSQL I am having a problem to select a column from a group, below is my query
var qry = (from i in INTERNETDATAs
join c in COVERS on Convert.ToInt32(i.COVERTYPE) equals c.COV_TYPE
join b in BENEFITS on c.COVERID equals b.COVERID
join p in POLICies on i.REFERENCENO equals p.BACS_POLNO into grp
where i.DATELOADED >= new DateTime(2013,1,1)
&& i.DATELOADED < new DateTime(2014,1,1)
&& i.CAMPAIGNTYPE == "1"
&& c.COVERTYPEID == 17063789
orderby i.DOB
select new
{
i.ID,
Campaign = i.CAMPAIGNTYPE,
Title = i.TITLE,
Dob = i.DOB,
Accepted = i.ACCEPTED,
BankLetter = i.BANKLETTER,
MonthlyPremium = c.MONTHLYPREMIUM,
BenefitAmount = b.BENEFITAMOUNT,
Description = b.BENEFITDESCRIPTION
}
).DefaultIfEmpty();
qry.Dump();
This query gives expected result but I alos need a STATUS column from POLICies table, when I remove the comment for //p.STATUS or //grp.STATUS I get following Error as below
**Cannot execute text selection: 'System.Collections.Generic.IEnumerable<linqpad.user.policy>' does not contain a definition for 'STATUS' and no extension method 'STATUS' accepting a first argument of type 'System.Collections.Generic.IEnumerable<linqpad.user.policy>' could be found (press F4 to add a using directive or assembly reference)**
If any one can please help me out with this as I have tried everything I can.
Thanks