'Declaration
<ExtensionAttribute()> Public Shared Function Or( _ ByVal predicate As IPredicateDescription, _ ByVal other As IPredicateDescription _ ) As CompositePredicateDescription
'Usage
Dim predicate As IPredicateDescription Dim other As IPredicateDescription Dim value As CompositePredicateDescription value = DynamicQueryExtensions.Or(predicate, other)
[Extension()] public static CompositePredicateDescription Or( IPredicateDescription predicate, IPredicateDescription other )
Exception | Description |
---|---|
System.Exception | PredicateDescriptions can only be combined if their InstanceTypes are the same |
public void DynamicQueryOr() { var baseQuery = EntityQuery.Create(typeof(Customer)); var expr1 = new PredicateDescription("Country", FilterOperator.IsEqualTo, "Mexico"); var expr2 = new PredicateDescription("CompanyName", FilterOperator.StartsWith, "A"); var list = manager.ExecuteQuery(baseQuery.Where(expr1.Or(expr2))); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2