.MapGet("some/url/structure", (string foo, int bar) => HandleRequest(foo, bar));
foo
and bar
there, can you just give it MyRequestObject
that has properties Foo
and Bar
and have it do model binding?
Result<T>
type to let you signal error results without exceptions, for cases where errors are expected and not exceptional
return Results.NotFound<User>(query.UserId);
rather than having to throw new UserNotFoundException(query.UserId);
var result = await _mediator.Send(query);
return MapToResponse(result);
that looks promising but might require consuming applications to write binders for everything
https://duck.com?id=help&subject=me
That's a string not a context, is there a simple way to convert it to something so I can just go Query["id"] or something similar?
nevermind, typing it out I remember about HttpUtlity ... duh, thanks for being my rubber duck guys
https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.parsequerystring?view=net-6.0
Hello, I have an asp.net core web application hosted on an azure app service. Is it possible to remote debug this application from visual studio ? I have tried to remote debug an asp.net core web application hosted on an IIS web server. It works fine. But azure app service does not work with IIS. It seems to run dotnet run command. So i don't know how can i remote debug this app. Thanks
i think what you need can be inferred from here https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging-dotnet-core-linux-with-ssh?view=vs-2022
nevermind, typing it out I remember about HttpUtlity ... duh, thanks for being my rubber duck guys
https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.parsequerystring?view=net-6.0
you can also try json to split queries and remake them, i use this approach when i dont have access to httputility
wondering if there's something I could get from dependency injection and give it the request object from the HttpContext and the desired type, and it'd give me a populated instance
so if i understand correctly, you want to DI specific HTTPContext Request query param & get the output based on that? can you put a example request i think what you need is already available using controller conventions and route sniffing
T
and a HttpContext
, I'd like to be able to use some kind of BindToNewInstance<T>()
method that'll give me an instance of T
populated the way it would have been via model binding