Click here to Skip to main content
15,881,700 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am having a code snippet of logic 1.there are two dbset (1)deal dbset (2)archive dbset I want to join the two lists together where condition is
1. I am passing a value to the method and in query it will check list 2 for users with the particular ID, neglect them and then joins the result from second table to first table & there is one more condition that the archive in first table should not be equal to one.
I have already written code out of logic and i want it to be corrected out
can you guys help me with that?

XML
public List<Deal> GetDealsArc(int ID)
        {
            var deals = _dealcontext.deals.Where(x=>x.archive!=1).ToList();
            var archived = _dealarchivecontext.archiveDealBrokers.Where(x=>x.dealid == ID);

            var dealed = deals.Where(x=>archived.Any(y=>y.dealid == x.ID);

            return dealed.ToList();
        }
Posted
Comments
OriginalGriff 18-Jul-15 7:57am    
No, because that makes no sense to me at all.
What does "there is one more condition that the archive in first table should not be equal to one." mean?
Perhaps a short example of your two data sets and the results you expect would help?

there is one more condition that the archive in first table should not be equal to one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900