How to generate unique order number?

前端 未结 6 1647
情话喂你
情话喂你 2021-02-06 06:59

I\'m looking for a good way to generate a unique order ID. Can you see any problems with the code below?

int customerId = 10000000;

long ticks = DateTime.UtcNow         


        
6条回答
  •  情话喂你
    2021-02-06 07:41

    I'd use the IDENTITY column and if not that, use System.Guid.NewGuid() to generate a GUID for you.

提交回复
热议问题