嘗試創建Lambda表達式以從包含七個Guid值中的任何一個的數據庫中選擇記錄。多個Guid的Lambda表達式
當我嘗試以下方法:
searchedOpps = searchedOpps.Where(s => s.STAGEID == stageAGuid && stageAPlusGuid && //etc);
我得到一個Operator '&&' cannot be applied to operands of type 'bool' and 'System.Guid'
,同爲||
(不知道這還是我應該使用這兩種運營商的)
如果我嘗試:
searchedOpps = searchedOpps.Where(s => s.STAGEID == stageAGuid);
searchedOpps = searchedOpps.Where(s => s.STAGEID == stageAPlusGuid);
沒有返回
的是否大人可以幫助我嗎?
您必須重複變量名稱。 'searchableOpps = searchingOpps.Where(s => 1stageAGuid || s.STAGEID == stageAPlusGuid || // etc)' – xanatos
來自數據庫? – rpax