this is my public System.Guid Id { get; set; } my property. how to convert these guid to int.
plz help me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Arunava BhattacharjeePosted Sep 26, 2014, 8:15 AM
public static Guid ToGuid(int value)
{
byte[] bytes = new byte[16];
BitConverter.GetBytes(value).CopyTo(bytes, 0);
return new Guid(bytes);
}
Mark the answer as accepted :)
padmapriya patruniPosted Sep 26, 2014, 8:10 AM
Arunava BhattacharjeePosted Sep 26, 2014, 8:00 AM
If you still want to put bugs, use this:
public static BigInteger GetNumericGuid()
{
return new BigInteger(Guid.NewGuid().ToByteArray());
}
mark this as accepted.