How to do single page routing in dotnet 3

I have an application which is built using both client side routing using react and server side routing using MapRazorPages. I need to map tasks/* to a specific view and map everything to razor pages. I’m completely new to dotnet so I don’t really know what I’m doing but so far as I can tell I should be able to do something like this:

Generate a secure double defined on range [0.0d – 1.0d] (both inclusive)

I need to know how to generate a secure double defined on range [0.0 – 1.0] both inclusive.
I generate two big ulong numbers with RNGCryptoServiceProvider class, make sure that the second number is greater or equals to the first number and then divide the first number by the second number and cast result to double. Ideally, numbers 0.0d and 1.0d should be included in this range, but they’re never included. It must be something with mantissa with double values. Do you know how to fix it?