Click here to Skip to main content
15,900,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using IList.Contains to search nested members? Pin
Matt T Heffron21-Aug-12 15:27
professionalMatt T Heffron21-Aug-12 15:27 
AnswerRe: Using IList.Contains<> to search nested members? Pin
BobJanova22-Aug-12 0:41
BobJanova22-Aug-12 0:41 
Questionplz help with ghe following.... Pin
joy madalane21-Aug-12 12:59
joy madalane21-Aug-12 12:59 
AnswerRe: plz help with ghe following.... Pin
Wes Aday21-Aug-12 15:49
professionalWes Aday21-Aug-12 15:49 
JokeRe: plz help with ghe following.... Pin
Mycroft Holmes21-Aug-12 20:07
professionalMycroft Holmes21-Aug-12 20:07 
AnswerRe: plz help with ghe following.... Pin
OriginalGriff21-Aug-12 21:09
mveOriginalGriff21-Aug-12 21:09 
GeneralRe: plz help with ghe following.... Pin
joy madalane21-Aug-12 21:27
joy madalane21-Aug-12 21:27 
GeneralRe: plz help with ghe following.... Pin
OriginalGriff21-Aug-12 21:47
mveOriginalGriff21-Aug-12 21:47 
QuestionDifferent object depending on variable value Pin
suzyb21-Aug-12 3:50
suzyb21-Aug-12 3:50 
AnswerRe: Different object depending on variable value Pin
OriginalGriff21-Aug-12 4:06
mveOriginalGriff21-Aug-12 4:06 
GeneralRe: Different object depending on variable value Pin
Pete O'Hanlon21-Aug-12 4:31
mvePete O'Hanlon21-Aug-12 4:31 
AnswerRe: Different object depending on variable value Pin
Pete O'Hanlon21-Aug-12 4:40
mvePete O'Hanlon21-Aug-12 4:40 
AnswerRe: Different object depending on variable value Pin
Eddy Vluggen21-Aug-12 4:53
professionalEddy Vluggen21-Aug-12 4:53 
GeneralRe: Different object depending on variable value Pin
suzyb21-Aug-12 5:40
suzyb21-Aug-12 5:40 
GeneralRe: Different object depending on variable value Pin
Eddy Vluggen21-Aug-12 5:46
professionalEddy Vluggen21-Aug-12 5:46 
AnswerRe: Different object depending on variable value Pin
jschell22-Aug-12 8:50
jschell22-Aug-12 8:50 
QuestionAutomatically optimize all tables in a MySQL database Pin
Alagiri.periyasamy@merrillcorp.com21-Aug-12 1:46
Alagiri.periyasamy@merrillcorp.com21-Aug-12 1:46 
AnswerRe: Automatically optimize all tables in a MySQL database Pin
Eddy Vluggen21-Aug-12 1:51
professionalEddy Vluggen21-Aug-12 1:51 
GeneralRe: Automatically optimize all tables in a MySQL database Pin
Alagiri.periyasamy@merrillcorp.com21-Aug-12 2:05
Alagiri.periyasamy@merrillcorp.com21-Aug-12 2:05 
AnswerRe: Automatically optimize all tables in a MySQL database Pin
Eddy Vluggen21-Aug-12 2:17
professionalEddy Vluggen21-Aug-12 2:17 
QuestionLinq - Conditions for two categories in parallel Pin
Ronenb21-Aug-12 1:18
Ronenb21-Aug-12 1:18 
AnswerRe: Linq - Conditions for two categories in parallel Pin
Wayne Gaylard21-Aug-12 3:21
professionalWayne Gaylard21-Aug-12 3:21 
First off, this should have been posted in the LinQ forum LinQ Forum[^], but as you posted here, I will answer here.

You can use the Contains keyword to find if the item's property list contains the required property, something like this:-
SQL
var itemQuery = DB.Where((i) => i.name == "car" &&
            i.propList.Contains((from prop in i.propList where prop.name == "Colour " && prop.value == "Red" select prop).FirstOrDefault()) &&
            i.propList.Contains((from prop in i.propList where prop.name == "Year" && prop.value == "2012" select prop).FirstOrDefault()));

although this looks ugly and seems to be a bit of a hack it will return the correct item.

Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

AnswerMessage Removed Pin
21-Aug-12 3:40
professionalN_tro_P21-Aug-12 3:40 
GeneralRe: Linq - Conditions for two categories in parallel Pin
Ronenb22-Aug-12 20:54
Ronenb22-Aug-12 20:54 
GeneralRe: Linq - Conditions for two categories in parallel Pin
Ronenb26-Aug-12 21:59
Ronenb26-Aug-12 21:59 

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.