Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
GeneralRe: Spinning Roulette Wheel Pin
stephen.darling10-Sep-11 3:02
stephen.darling10-Sep-11 3:02 
AnswerRe: Spinning Roulette Wheel Pin
Alan Balkany14-Sep-11 5:26
Alan Balkany14-Sep-11 5:26 
GeneralRe: Spinning Roulette Wheel Pin
stephen.darling15-Sep-11 2:30
stephen.darling15-Sep-11 2:30 
GeneralRe: Spinning Roulette Wheel Pin
Alan Balkany15-Sep-11 4:17
Alan Balkany15-Sep-11 4:17 
GeneralRe: Spinning Roulette Wheel Pin
stephen.darling15-Sep-11 4:34
stephen.darling15-Sep-11 4:34 
QuestionComparing 2 lists Pin
nitin_ion8-Sep-11 3:12
nitin_ion8-Sep-11 3:12 
AnswerRe: Comparing 2 lists Pin
PIEBALDconsult8-Sep-11 3:15
mvePIEBALDconsult8-Sep-11 3:15 
AnswerRe: Comparing 2 lists Pin
BobJanova8-Sep-11 3:29
BobJanova8-Sep-11 3:29 
That's what the selection on list2 will give. (Think about it for a moment.)

What you want is something along the lines of
var matches = list1.Where(x => list2.Contains(x));


Since you apparently want a value comparison you should override Equals (and maybe == too) on Emp. That would test that all the properties matched (and I think it would make Contains work in the above expression).

If you really want to check that any of the properties match, you need to write a Contains equivalent (it's a one line LINQ expression). But that seems unlikely.

Ideally you'd be using the same actual object for what appears to be a reference to the same database row, but if it's actually coming out of a database provider that may not be possible. Classes that represent database entities often want value semantics for equality (unless you're using some clever entity management framework that gives you the same instance for the same row).
AnswerRe: Comparing 2 lists Pin
Wayne Gaylard8-Sep-11 4:08
professionalWayne Gaylard8-Sep-11 4:08 
AnswerRe: Comparing 2 lists Pin
Daniel.Grondal8-Sep-11 21:46
Daniel.Grondal8-Sep-11 21:46 
QuestionUploading already use file Pin
sarang_k8-Sep-11 1:34
sarang_k8-Sep-11 1:34 
AnswerRe: Uploading already use file Pin
BobJanova8-Sep-11 1:49
BobJanova8-Sep-11 1:49 
GeneralRe: Uploading already use file Pin
sarang_k8-Sep-11 2:11
sarang_k8-Sep-11 2:11 
GeneralRe: Uploading already use file Pin
MicroVirus8-Sep-11 5:00
MicroVirus8-Sep-11 5:00 
GeneralRe: Uploading already use file Pin
BobJanova8-Sep-11 6:12
BobJanova8-Sep-11 6:12 
GeneralRe: Uploading already use file Pin
Eddy Vluggen8-Sep-11 6:53
professionalEddy Vluggen8-Sep-11 6:53 
GeneralRe: Uploading already use file Pin
BobJanova8-Sep-11 10:25
BobJanova8-Sep-11 10:25 
GeneralRe: Uploading already use file Pin
Eddy Vluggen8-Sep-11 10:34
professionalEddy Vluggen8-Sep-11 10:34 
GeneralRe: Uploading already use file Pin
MicroVirus8-Sep-11 13:07
MicroVirus8-Sep-11 13:07 
QuestionDirectShowNET Framework 4.0 and 2.0 Pin
semixor8-Sep-11 1:10
semixor8-Sep-11 1:10 
AnswerRe: DirectShowNET Framework 4.0 and 2.0 Pin
Eddy Vluggen8-Sep-11 7:00
professionalEddy Vluggen8-Sep-11 7:00 
GeneralRe: DirectShowNET Framework 4.0 and 2.0 Pin
semixor8-Sep-11 9:01
semixor8-Sep-11 9:01 
AnswerRe: DirectShowNET Framework 4.0 and 2.0 Pin
Eddy Vluggen8-Sep-11 9:11
professionalEddy Vluggen8-Sep-11 9:11 
QuestionIBasicVideo + NullRenderer ( How ? ) Pin
semixor8-Sep-11 0:50
semixor8-Sep-11 0:50 
AnswerRe: IBasicVideo + NullRenderer ( How ? ) Pin
MicroVirus8-Sep-11 4:49
MicroVirus8-Sep-11 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.