Last active
November 29, 2021 09:49
-
-
Save georgekosmidis/002c3a36dcaf3c2acc51ee19ddf43ba5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var bytes = new Span<byte>(new byte[256]); //arbitrary number | |
| if (Convert.TryFromBase64String("YOUR_BASE64_STRING_HERE", bytes, out int bytesWritten)) | |
| { | |
| var guidDecoded = new Guid(bytes.Slice(0, bytesWritten).ToArray()).ToString(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var base64Encoded = Convert.ToBase64String("YOUR_GUID_HERE"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PriceSet | |
| { | |
| [BsonId] | |
| public Guid Id { get; init set; } | |
| public decimal Price { get; init set; } | |
| //... | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment