LINQ-to-SQL Joins?

Or you could add an into after the join like this: (from payroll in ActiveContext. Payrolls join payStub in ActiveContext. PayStubs on payroll.

PayrollID equals payStub. PayrollID into payStubGroup where payStubGroup. Any(p => p.

InternalPayrollTaxes.Any()) select payroll ).ToList().

Thanks so much! The .Distinct().ToList() worked very well for me! – SaiBand Jul 15 at 21:04 @Sai You should avoid using Distinct for this kind of stuff as it has bad performance.

– Magnus Jul 15 at 23:29.

I think using Any (EXISTS in SQL) might help you here. Public IList GetPayrollsWithPayrollTaxes() { return (from payroll in ActiveContext. Payrolls where ActiveContextPayStubs.

Any(payStub => payroll. PayrollID == payStub. PayrollID && payStub.

InternalPayrollTaxes.Any()) select payroll ).ToList(); }.

The syntax for joins in LINQ to SQL look very much like the familiar syntax for joins found in SQL code. Notice in particular lines 5 and 6, which form the heart of the query. In line 6, for instance, we can see that the join is formed on the ProductId field shared by each table.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions