Page 1 of 1

AutoQuery Calls from another service

PostPosted: Fri Feb 03, 2023 4:07 pm
by SBarnes
Is there a way to call an auto query route like the routes under queries from another service?

Similar to using base.ResolveService.

Re: AutoQuery Calls from another service  Topic is solved

PostPosted: Fri Feb 03, 2023 5:26 pm
by SBarnes
Well I worked out the answer for myself its as simple as on your service class declare the AutoQuery property like this


Code: Select all
public IAutoQueryDb AutoQuery { get; set; }


then inside your method do this, which is based upon the documentation of doing a custom auto query.

Code: Select all
      var req =  new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_MainQuery();
                var q = AutoQuery.CreateQuery(req, base.Request, Db);
                var result = AutoQuery.Execute(req, q, base.Request, Db);