Clicky

           return (from l1 in xmlWords.Words
                    join l2 in viewWords.Words
                    on l1 equals l2
                    select l1).Count();


xmlWords contains these five words: TEST LABEL FOR UNIT TEST
viewWords contains these three words: TEST LABEL UNIT

I would like the match count to be 3 in this case, but right now its 4.

Anybody know how to fix this? I suppose I could remove duplicates from one or both lists prior to running the test, but is there a better way?

Thanks!

asked 12/15/2011 12:27

newbieweb's gravatar image

newbieweb ♦♦


2 Answers:
Check with this querry

 return (from l1 in xmlWords.Words
                    join l2 in viewWords.Words
                    on l1 equals l2
                    select l1).Distinct().Count();
link

answered

santhimurthyd's gravatar image

santhimurthyd

Thanks!
link

answered 2011-12-15 at 09:46:33

newbieweb's gravatar image

newbieweb

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 12/15/2011 12:27

Seen: 179 times

Last updated: 12/15/2011 11:43