TechTalk Genome v4.2

Sql.IsIn Method (Object, Set)

Determines whether an element is in the collection.

public static bool IsIn(
   object item,
   Set s
);

Parameters

item
The scalar object to locate in s.
s
The Set to be investigated. Must have scalar Set.ElementType.

Return Value

true if item is found in s; otherwise, false.

Remarks

The method is translated into a SQL "IN" operator when used on the server side. The specified set is translated into a sub-query expression like this:

          ... Age IN (SELECT Age FROM Animal WHERE Name LIKE 'A%') ...
        

Note: The actual values are passed as parameters.

To use the IN operator when enumerating the items individually, use the IsIn overload.

Example

          
Set selectedAges = dataDomain.Extent(typeof(Animal))["Name.IsLike({0})", "A%"].Select("Age");
Set selectedAnimals = dataDomain.Extent(typeof(Animal))["TechTalk.Genome.Sql.IsIn(Age, {0})", selectedAges];
                

Requirements

Namespace: TechTalk.Genome

Assembly: TechTalk.Genome (in TechTalk.Genome.dll)

Version: 4.2.4.4

Editions: Professional, Evaluation, Express

See Also

Sql Class | TechTalk.Genome Namespace | Sql.IsIn Overload List | IsIn | Set.Contains