문제

I'm in the process of making one of my distributed c# .net libraries cross platform so I can deploy it to linux via mono and have come across an issue: I use a sequential GUID for generating ID's like this:

[DllImport("rpcrt4.dll", SetLastError = true)]
public static extern int UuidCreateSequential(out Guid guid);

This is obviously only good on a Windows platform.

Should I just forget about the sequential guid creation bit on linux and use a random guid? or does anyone have any suggestions on how I can replace the DllImport with something more appropriate?

도움이 되었습니까?

해결책

NHibernate has managed code to do this in the GuidCombGenerator.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top