Noel
Noel

Reputation: 593

Reading Java UUID (from DB) in C#

I'm trying to map a table, where one of the column is a binary array (which is a Java UUID), to a C# class.

I would like to read the byte array and return a string representation of the UUID. Just wondering what's a good place to start.

Upvotes: 1

Views: 512

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1499770

If you've already got it as a byte array, then just call new Guid(bytes) to get a Guid; you can call ToString on that to convert it to a string if you particularly need to. (I'd suggest leaving it as a Guid though other than for diagnostics.)

Upvotes: 1

Related Questions