Click here to Skip to main content
15,888,802 members
Home / Discussions / C#
   

C#

 
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 
XML
Hi
I’ve a question regarding linq,
I’ve a DB contains main items (Product) and internal item(properties)

Class Product
{
    String name
List<properties> propList { get; set; }
}

Class properties
{
    String name
String value
}

I would like to know if it possible to create a query that apply on two or more categories on the same internal item at one time
Such as, if the product is "car" and if the car year is 2012 and color is "Red" I would like to get this record

List< Product > DB;

I know the syntax below is wrong, but this is the idea I wish to do
Enumerable< Product > itemQuery = from item in DB where item.name=="car"
                                            where
                                            (
                                                from prop in item.propList
                                                where (prop.name.Equals("Color") && prop.value == "Red") && (prop.name.Equals("Year") && prop.value == "2012")
                                                select field
                                             ).Any()
                                            select item;

AnswerRe: Linq - Conditions for two categories in parallel Pin
Wayne Gaylard21-Aug-12 3:21
professionalWayne Gaylard21-Aug-12 3:21 
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 
GeneralMessage Removed Pin
27-Aug-12 2:41
professionalN_tro_P27-Aug-12 2:41 
GeneralRe: Linq - Conditions for two categories in parallel Pin
Ronenb27-Aug-12 5:46
Ronenb27-Aug-12 5:46 
GeneralDynamic Keyword Pin
gopesh201020-Aug-12 23:12
gopesh201020-Aug-12 23:12 
GeneralRe: Dynamic Keyword Pin
Pete O'Hanlon20-Aug-12 23:35
mvePete O'Hanlon20-Aug-12 23:35 
QuestionSame entries in Listbox from WCF Pin
coem20-Aug-12 22:19
coem20-Aug-12 22:19 
AnswerRe: Same entries in Listbox from WCF Pin
coem21-Aug-12 0:14
coem21-Aug-12 0:14 
QuestionEPPLUS excel percent format Pin
Member 916988720-Aug-12 20:10
Member 916988720-Aug-12 20:10 
QuestionRe: EPPLUS excel percent format Pin
Richard MacCutchan20-Aug-12 21:29
mveRichard MacCutchan20-Aug-12 21:29 
AnswerRe: EPPLUS excel percent format Pin
Member 916988721-Aug-12 14:06
Member 916988721-Aug-12 14:06 
AnswerRe: EPPLUS excel percent format Pin
Jay Nardev21-Aug-12 20:44
Jay Nardev21-Aug-12 20:44 
QuestionWait until user finish typing Pin
biop.codeproject20-Aug-12 17:59
biop.codeproject20-Aug-12 17:59 
AnswerRe: Wait until user finish typing Pin
AmitGajjar20-Aug-12 18:39
professionalAmitGajjar20-Aug-12 18:39 
AnswerRe: Wait until user finish typing Pin
Paul Conrad20-Aug-12 19:32
professionalPaul Conrad20-Aug-12 19:32 

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.