Using AutoQuery with a Razor Template

Is it possible to get the API benefits of using AutoQuery, but still use a Razor template for HTML rendering?

I have an AutoQuery ServiceModel which looks like this:

[Route("/devices", "GET")]
[Route("/devices/{DeviceId}", "GET")]
public class GetDevices : QueryDb<WebRemote.ServiceModel.Types.Device>
    public string DeviceId { get; set; }

Here’s the Razor template I’m trying to apply: Devices.cshtml:

@inherits ViewPage<WebRemote.ServiceModel.Types.Device>
    ViewBag.Title = "Devices";


I’m also tried using

@inherits ViewPage<QueryDb<WebRemote.ServiceModel.Types.Device>>

Is there a way to do this, or does using AutoQuery prevent me from applying a Razor template to this API endpoint?

Also: Is this a rediculous thing to want to do? Generally when I can’t find an answer it’s because I’m doing something rediculous. Hehe.



The Razor view should be named after the Request DTO (I.e. GetDevices) or the Response DTO and located inside the /Views/ folder. The model should be the Response DTO, I.e.

@inherits ViewPage<QueryResponse<Device>>