a) Shouldn’t this line also check that concrete types are being generated?
I got round this by
var nativeTypes = this.GetPlugin<NativeTypesFeature>();
nativeTypes.MetadataTypesConfig.AddReturnMarker = false;
But, this still left the QueryDb, which will still generate the concrete “createResponse()” methods. Only way I could sort this out was to exclude all my QueryDb Types from generation.
In answer to your question, below is method that is returning a QueryResponse
public object Get(GetMeterReadingsRequest request)
{
var q = AutoQuery.CreateQuery(request, Request.GetRequestParams());
var result = AutoQuery.Execute(request, q);
result.Results.ForEach(r =>
{
if (r.AccountId.HasValue) r.Account = AccountBusiness.Get(r.AccountId.Value);
if (r.BoatId.HasValue) r.Boat = AccountBusiness.GetBoat(r.BoatId.Value);
});
return result;
}
I should remove ExportAsTypes as it’s not for use in ambient type declarations ending with .d.ts. If you want to generate concrete types you should uncheck “Only TypeScript definitions” in the dialog (which is now the default):
This will generate a *.dtos.ts file instead of a .d.ts file where concrete types should no longer be wrapped in a module by default. I’ll see if I can repro the issue with AutoQuery Services with ambient type declarations.