T
Chili.Opf3 Send comments on this topic.
Generic ObjectQueryBuilder Class
See Also  Members   Example 
Chili.Opf3.Query Namespace : Generic ObjectQueryBuilder Class




A class that creates an instance of an ObjectQuery class.

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class ObjectQueryBuilder(Of T) 
Visual Basic (Usage)Copy Code
Dim instance As ObjectQueryBuilder(Of T)
C# 
public sealed class ObjectQueryBuilder<T> 
Managed Extensions for C++ 
public __gc __sealed class ObjectQueryBuilder<T> 
C++/CLI 
generic<typename T>
public ref class ObjectQueryBuilder sealed 

Type Parameters

T

Example

The following example shows how to use ObjectQueryBuilder in your application.
C#Copy Code
// ... Other code 
 
ObjectQueryBuilder<Call> ob = new ObjectQueryBuilder<Call>(); 
ob.AppendProperty("CallDuration", Comparisons.Equals, 1); 
ob.AppendProperty("CallName", Comparisons.Like, "%foo"); 
ob.AppendConcat(Concats.Or); 
ob.AppendOpeningParenthesis(); 
ob.AppendProperty("CallName", Comparisons.Equals, "Bar"); 
ob.AppendClosingParenthesis(); 
 
ObjectSet<Call> os = context.GetObjectSet<Call>(ob.ToObjectQuery()); 
 
// ... Other code.

Remarks

This class creates an instance of an ObjectQuery class. It allows to specify the different items that can be added to an ObjectQuery. For more information about the ObjectQuery, please consult the documentation of that class.

The class does also check if the added properties are valid for the given persistent object and if the amount of opening parenthesis match the closing parenthesis. It is possible to call the AppendProperty method without calling the AppendConcat: in that case the class uses the concat specified in the DefaultConcat property to connect the two properties in the query.

Inheritance Hierarchy

System.Object
   Chili.Opf3.Query.ObjectQueryBuilder

Requirements

Namespace: Chili.Opf3.Query

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also