Is it possible to add ordering on the service model?
I know I could specify ordering at the service interface level:
public async Task<List<Application>> GetApplicationsAsync()
{
using var db = AutoQuery!.GetDb<Application>(Request);
var find = new SearchApplication();
var q = AutoQuery.CreateQuery(find, Request, db);
q.OrderBy("Code");
var result = await db.SelectAsync(q);
return result.Results;
}
However, I only define service implementations when necessary (e.g. business logic). So, for simple database queries, I would only have the service model:
[Route("/api/search/application", "GET")]
public class SearchApplication : QueryDb<Application>, IGet
{
public Guid? Id { get; init; }
public string? Code { get; set; }
}
So, how would I apply those properties to the Service model definition of SearchApplication below?
[Route("/api/search/application", "GET")]
public class SearchApplication : QueryDb<Application>, IGet
{
public Guid? Id { get; init; }
public string? Code { get; set; }
}