✅ Sending an HTTP Exception in Web API
I am having some trouble with sending an HTTP exception in web api as it seems how its dont has changed over the course of different .net versions.
There seems to be an issue of what return type I have, but I found examples online where people were able to do it with an ActionResult.
I found examples which implemented it like this but it will not compile for me because it cannot convert the return type.
I have also tried what is shown on the learn microsoft page where it says essentially to do
However doing so causes my server to encounter an unhandled exception and cease to work.
What is the correct way of doing this in .net 6???
There seems to be an issue of what return type I have, but I found examples online where people were able to do it with an ActionResult.
I found examples which implemented it like this but it will not compile for me because it cannot convert the return type.
I have also tried what is shown on the learn microsoft page where it says essentially to do
However doing so causes my server to encounter an unhandled exception and cease to work.
What is the correct way of doing this in .net 6???
