-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When looking at the samples, one things that comes to my mind is
- Use DI. Statics are an anti-pattern in .NET. E.g. Inject HttpOutbound
- Routing would be great, just like we have with minimal APIs or MVC controllers. Currently we do
if (request.Url.StartsWith("/outbound"))
{
return UseOutboundHttp(request);
}
return request.Url switch
{
"/redis" => UseRedis(request),
"/pg" => UsePostgresQuery(request),
"/pgins" => UsePostgresExec(request),
_ => EchoRequestInfo(request),
};
- Model binding. .NET devs love (and need ;-)) model bindings, not just strings.
- Return messages. Currently we need to do clumsy things, like
return new HttpResponse
{
StatusCode = System.Net.HttpStatusCode.OK,
Headers = new Dictionary<string, string>
{
{ "Content-Type", "text/html" },
},
BodyAsString = html,
};
- Would there be a way to not have a new, custom programming model, but rather integrate e.g. with minimal APIs?
From: https://discord.com/channels/926888690310053918/1050347475287945246/1050382904909381652
ChristianWeyerjpflueger
Metadata
Metadata
Assignees
Labels
No labels