Skip to content

Instantly share code, notes, and snippets.

@LucasMoffitt
Created July 7, 2014 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucasMoffitt/aaa7865ca696f60d9e0a to your computer and use it in GitHub Desktop.
Save LucasMoffitt/aaa7865ca696f60d9e0a to your computer and use it in GitHub Desktop.
I Support UUID Cruelty.
public class UUIDObliterator
{
private readonly Random _random;
public UUIDObliterator()
{
_random = new Random();
}
private void Obliterate()
{
var guidBloodLustSedated = false;
do
{
Guid? deathRowGuid = Guid.NewGuid();
var purposeGivenGuid = new APurposeGivenGuid(deathRowGuid, "I HAVE A PURPOSE!");
purposeGivenGuid = null;
deathRowGuid = null;
guidBloodLustSedated = DoneYet();
} while (!guidBloodLustSedated);
}
private bool DoneYet()
{
var done = _random.Next(0, 1000);
return done == 666;
}
}
public class APurposeGivenGuid
{
public Guid? Guid { get; private set; }
public string Purpose { get; private set; }
public APurposeGivenGuid(Guid? guid, string purpose)
{
Guid = guid;
Purpose = purpose;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment