RE: Linq Query
- From: Pankaj <Pankaj@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Aug 2008 08:55:07 -0700
Please go to http://www.a2zdotnet.com/Default.aspx
for step by step tutorials for beginers in LINQ sections.
--
regards,
Pankaj
http://www.A2ZDotNet.com
"shapper" wrote:
Hello,.
I have two Lists:
A = {ID, Name} = { (Null, John), (Null, Mary), (Null, Andrew), (Null,
Peter) }
B = {ID, Name} = { (1, John), (2, Robert), (3, Angela), (4, Andrew) }
I want to find which items in A do not exist in B then:
1. Add the items to B and using an ID from the function GetID(). B
would become:
B = {ID, Name} = { (1, John), (2, Robert), (3, Angela), (4,
Andrew), (231, Mary), (45, Peter) }
2. Then update the A list, or create a new one (C), to get the created
items:
C = {ID, Name} = { (231, Mary), (45, Peter) }
How can I do this with LINQ?
I have been trying a join but with the something as "not equals" but
it does not work.
I think I might need to do this in 3 steps:
1. Get items in B that do not exist in C;
2. Insert those items in C;
3. Get those items again from C to get the created ID's with the
correspondent names.
Could someone help me out with this?
Thanks,
Miguel
- Prev by Date: RE: LINQ book
- Next by Date: RE: Historic values in LINQ
- Previous by thread: RE: LINQ book
- Next by thread: RE: Historic values in LINQ
- Index(es):
Relevant Pages
|