Hi,
First of all thank you for all the work in building this amazing framework
I am just playing with the razor pages, and i have find out how to call a service from a razor page.
Basically i’m trying to create a form to add a new listing.
i have made a new.cshtml page inside a listings folder and i’m fetching categories from an autoquery service with the following call to populate a select field
var categoriesResponse = await Gateway.SendAsync(new QueryCategories());
The problem i’m having is that in the case the form has an error, when the service call to get categories is executed again after submit it return an empty list.
i have tried to override the auto query with the following service
public class CategoriesService : Service
{
public IAutoQueryDb AutoQuery { get; set; }
public object Any(QueryCategories queryCategories)
{
var q = AutoQuery.CreateQuery(queryCategories, Request);
return AutoQuery.Execute(queryCategories, q, Request);
}
}
What i have noticed that is somehow intercept some values from the form and because of that the sql expression is getting generated is the following and it will output an empty list
FROM "category" WHERE "category"."name" IS NULL AND "category"."id" = :1
What i’m doing wrong?
Thank you