Hi,
I'm developing a Blazor Server application and I "declared" this EndPoint in the "Configure" of the Startup.cs file:
endpoints.MapGet("/products/GetProduct/{ProductType}/{ProductSerialNumber}", (context) =>
{
string ProductType = Convert.ToString(context.GetRouteValue("ProductType"));
string ProductSerialNumber = Convert.ToString(context.GetRouteValue("ProductSerialNumber"));
(var product , var errors) = app.ApplicationServices.GetService<ProductsServices>().GetProduct(ProductType, ProductSerialNumber);
var json = JsonSerializer.Serialize<Product>(product);
return context.Response.WriteAsync(json);
});
How can I get the "errors" object back too? is it possible to manage the return of two or more objects?
Best
Stefano