How do join two lists without have same fields using linq?

It's unclear from the question, but perhaps you mean: var C = A. Zip(B, (a, b) => a + b) .ToList() If you want to hand over the addition to your M2 method, you could do: C# 4 var C = A. Zip(B, M2); // C# 3 (not likely since Zip was introduced in .

NET 4) var C = A. Zip(B, (a, b) => M2(a, b)); var C = A. Zip(B, M2).

It's unclear from the question, but perhaps you mean: var C = A. Zip(B, (a, b) => a + b) .ToList(); If you want to hand over the addition to your M2 method, you could do: // C# 4 var C = A. Zip(B, M2); // C# 3 (not likely since Zip was introduced in .

NET 4) var C = A. Zip(B, (a, b) => M2(a, b)); var C = A. Zip(B, M2).

I like achieve it by method call only not directly – ratty Dec 16 '10 at 8:09 1 @ratty: That isn't clear at all. Perhaps you could give us some sample input / output? Or something that compiles.

– Ani Dec 16 '10 at 8:10 1 @ratty: Then replace the lambda with the method: A. Zip(B, M2) – VVS Dec 16 '10 at 8:11 @VVS: I think you might be onto something. I've put that in.

– Ani Dec 16 '10 at 8:16 @Ani: I don't understand why there's a different C# 3 version. – VVS Dec 16 '10 at 8:18.

Trying to join two tables that have a 1 to many relationship. The issue was that I was trying to get all the rows from one table, and where there where, get the corresponding entries from the other table. In short, I have one table containing to-do-lists and one table containing the tasks for each list.

But I have been a good boy and done all the tasks on some lists so they are empty. When I tried to join them, I only got back the lists that had task on them. I dusted off my old copy of SQL Queries For Mere Mortals and was able to do it in SQL.

But then I wanted to do it with SQL to LINQ. After a few hours, I couldn't get any further. Tried to Google it and came up short.

I'm trying to get data from two tables, Todo_Lists and Todo_Items. That's all good in the hood if I just want the lists with Items on them. But I need to return all the lists, and where there are Items, I need them to be joined in.

Thankful for any information. That's the good thing living in the far north, we have day when the US has night!

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