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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Arunava BhattacharjeeRank #635 · 3.8K reputationPosted Sep 26, 2014, 4:15 AM EDT
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 :)
Arunava BhattacharjeeRank #635 · 3.8K reputationPosted Sep 26, 2014, 4:00 AM EDT
If you still want to put bugs, use this:
public static BigInteger GetNumericGuid()
{
return new BigInteger(Guid.NewGuid().ToByteArray());
}
mark this as accepted.
padmapriya patruni75 reputationPosted Sep 26, 2014, 4:10 AM EDT