/// <summary>
        /// Insert list of nodes into database as bulk
        /// </summary>
        /// <param name="nodesList">List of nodes fo insert</param>
        public void InsertBulk(List <Node> nodesList)
        {
            var adapter    = new GraphTableAdapters.NodesTableAdapter();
            var newRecords = new Graph.NodesDataTable();

            foreach (var node in nodesList)
            {
                newRecords.AddNodesRow(node.id, node.label, node.adjacentNodes);
            }
            adapter.Update(newRecords);
        }
        /// <summary>
        /// Retrieves list of Nodes with UniDirectional relationships
        /// </summary>
        /// <returns> List of Nodes from database</returns>
        public List <Node> GetNodes()
        {
            var adapter = new GraphTableAdapters.NodesTableAdapter();

            Graph.NodesDataTable nodesBack = adapter.GetData();
            IEnumerable <Node>   nodesList = nodesBack.Select(nodeBack => new Node
            {
                id            = (byte)nodeBack.id, //TODO change in Node to long cause contract failure
                label         = nodeBack.label,
                adjacentNodes = nodeBack.adjacentNodes
            });

            return(nodesList.ToList());
        }
        /// <summary>
        /// Insert list of nodes into database
        /// </summary>
        /// <param name="nodesList">List of nodes for insert</param>
        public int Insert(List <Node> nodesList)
        {
            var adapter = new GraphTableAdapters.NodesTableAdapter();

            foreach (var node in nodesList)
            {
                try
                {
                    adapter.Insert(node.id, node.label, node.adjacentNodes);
                }
                catch (Exception e)
                {
                    // In case of fail rest of node is inserted
                }
            }
            return(nodesList.Count);
        }