public MongoId(string value) { if (value == null) { throw new ArgumentNullException("value"); } var bytes = MongoIdHexer.ParseHexString(value); FromByteArray(bytes, 0, out _a, out _b, out _c); }
public static bool TryParse(string s, out MongoId objectId) { // don't throw ArgumentNullException if s is null if (s != null && s.Length == 24) { byte[] bytes; if (MongoIdHexer.TryParseHexString(s, out bytes)) { objectId = new MongoId(bytes); return(true); } } objectId = default(MongoId); return(false); }
public override string ToString() { return(MongoIdHexer.ToHexString(ToByteArray())); }