Esempio n. 1
0
        public Node GetNode(string id)
        {
            SerializedNode serializedNode = db.SerializedNodes.FirstOrDefault(x => x.Id == id);

            if (serializedNode != null)
            {
                Node node = serializedNode.GetDeserializedNode();
                return(node);
            }
            return(null);
        }
Esempio n. 2
0
        public Node GetNode(string id)
        {
            Node node;

            using (var db = new SqlConnection(connectionString))
            {
                db.Open();
                SerializedNode serializedNode = db.Query <SerializedNode>
                                                    ($"SELECT * FROM Nodes WHERE Id='{id}'").SingleOrDefault();

                node = serializedNode.GetDeserializedNode();
            }

            return(node);
        }