jeudi 16 avril 2020

Generate unique random number in ASP.NET Core

I'm working on a Hotspot service, using ASP.NET Core building a MVC application, and i need do generate a 6-digit (100000 to 999999) number to serve as the password for the user to connect and have internet access. That number needs to be unique in the database and it will be removed after some time (line a month).

What is the best way to generate this unique number? I'm using Entity Framework aswell and was wondering if that could help me in some way with this problem...

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire