This is a migrated thread and some comments may be shown as answers.

Getting an Object based on an OQL Query

1 Answer 74 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 20 Jul 2010, 05:35 PM
WIth the Designer Context Method, I want to Query OA and return a single object back to the WF designer to play around with

public class OASingleObjectOQL<TResult> : NativeActivity<TResult> where TResult : class
{
    [RequiredArgument]
    [Category("InArgs")]
    public InArgument<string> OQLQuery { get; set; }      
 
    public OASingleObjectOQL()
    {
        this.Constraints.Add(ConstraintHelper.VerifyParentIsObjectContextScope(this));
    }
 
    protected override void Execute(NativeActivityContext context)
    {
        OAObjectContext oaObjectContext = context.Properties.Find(OAObjectContext.ObjectContextPropertyName) as OAObjectContext;
        if (oaObjectContext == null)
        {
            throw new ValidationException("OpenAccess Object Context not found");
        }
 
 
        var output = ""; //QUERY CODE...?
 
        // set the result value
        this.Result.Set(context, output);          
    }      
}

I don't see any OQL query methods in my context....

Or is there a more efficient way to return a single object?...I'd try a Predicate, but I'm not sure of the VB style syntax to do that in the WF4 designer

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 21 Jul 2010, 03:58 PM
Hello Steve,

OQL is not supported by the context, generated by the visual designer.
You could however, use Dynamic Linq together with the GetAll<T> method of the context (in order to get an IQueryable instance).

I hope this helps. Do not hesitate to write again if you have more questions.

All the best,
Jordan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Integration with other products
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Jordan
Telerik team
Share this question
or