I am developing a Web application using ASP.Net Core. I need to make the HTTPS mandatory programatically irrespective of the hosting environment.
What is the easiest way that I can achieve this ? It would be great if you can provide me a code segment as well.