We've built an Linq provider using re-linq.
This implementation is using a webservice call sending translated sentence to the webservice endpoint:
public IEnumerable<T> ExecuteCollection<T>(QueryModel queryModel)
{
RemoveRelationClausesTransformer.TransformQueryModel(queryModel);
QueryModelTransformer.TransformQueryModel(queryModel);
GroupedReferencesQueryModelTransformer.TransformQueryModel(queryModel);
GroupedClausesQueryModelTransformer.TransformQueryModel(queryModel);
GroupedResultOperatorsQueryModelTransformer.TransformQueryModel(queryModel);
QueryModelTranslator translator = new QueryModelTranslator();
translator.Translate(queryModel);
SemanticModel.LQLQueryModel lqlQueryModel = translator.LqlQueryModel;
SemanticModel.Visitor.LQLQueryModelVisitor lqlQueryModelVisitor = new SemanticModel.Visitor.LQLQueryModelVisitor();
lqlQueryModel.Accept(lqlQueryModelVisitor);
return this.backend.LEST.LqlApiP.Search<T>(lqlQueryModelVisitor.Sentence);
}
Search()
method
returns an
IEnumerable<T>. Nevertheless LQLAPI provides an async version of this:
public interface ILqlApi
{
IEnumerable<T> Search<T>(string LqlSentence);
Task SearchAsync(string LqlSentence);
}
After having tested this implementation we're looking forward to use this async method instead of sync version.
We've not tested absolutly nothing yet. Nevertheless, are there some approaches to be able to call to our Linq sentence provider asynchronously?