Exemple #1
0
        /// <summary>
        ///     Creates a vertex from GraphSON using settings supplied in the constructor.
        /// </summary>
        public IVertex VertexFromJson(JObject json)
        {
            if (json == null)
            {
                throw new ArgumentNullException(nameof(json));
            }

            var props = ReadProperties(json, true, _hasEmbeddedTypes);

            var vertexId = GetTypedValueFromJsonNode(json[GraphSonTokens.Id]);
            var v        = _factory.CreateVertex(vertexId);

            foreach (
                var entry in props.Where(entry => IncludeKey(entry.Key, _vertexPropertyKeys, _vertexPropertiesRule)))
            {
                v.SetProperty(entry.Key, entry.Value);
            }

            return(v);
        }