Hi there, I have a Linq to SQl query in C#
var queryGetAllPricingData = from i in dB.Invoices
join c in dB.Contracts
on i.ContractId
equals
c.ContractId
where i.InvoiceStatusId == 100
select new { i, c]};
Then I do a test for any results:
if (queryGetAllPricingData.Count() > 0)
Then I want to use the results in a new method.
What do I pass to the new method? This does not appear to work
if (queryGetAllPricingData.Count() > 0)
{
GetPricingModel(queryGetAllPricingData);
}
internal void GetPricingModel(IQueryable queryGetAllPricingData)
{
foreach (var record in queryGetAllPricingData)
{
DO SOMETHING;
}
}
What should I be doing?