public static bool TryParse( string serializedCosmosElement, out CosmosElement cosmosElement) { if (serializedCosmosElement == null) { throw new ArgumentNullException(nameof(serializedCosmosElement)); } try { byte[] buffer = Encoding.UTF8.GetBytes(serializedCosmosElement); cosmosElement = CosmosElement.CreateFromBuffer(buffer); } catch (JsonParseException) { cosmosElement = default; } return(cosmosElement != default); }
public static bool TryParse( string serializedCosmosElement, out CosmosElement cosmosElement) { if (string.IsNullOrWhiteSpace(serializedCosmosElement)) { cosmosElement = default; return(false); } try { byte[] buffer = Encoding.UTF8.GetBytes(serializedCosmosElement); cosmosElement = CosmosElement.CreateFromBuffer(buffer); } catch (JsonParseException) { cosmosElement = default; } return(cosmosElement != default); }
public static new CosmosGuid CreateFromBuffer(ReadOnlyMemory <byte> buffer) => CosmosElement.CreateFromBuffer <CosmosGuid>(buffer);
public static new CosmosString CreateFromBuffer(ReadOnlyMemory <byte> buffer) { return(CosmosElement.CreateFromBuffer <CosmosString>(buffer)); }
public static CosmosElement CreateFromBuffer(ReadOnlyMemory <byte> buffer) { return(CosmosElement.CreateFromBuffer <CosmosElement>(buffer)); }
public static CosmosElement Parse(string json) { byte[] buffer = Encoding.UTF8.GetBytes(json); return(CosmosElement.CreateFromBuffer(buffer)); }