Пример #1
0
        public void addSite(string name, long id)
        {
            //this creates new objects even if they exist
            var newsite = new SitePoint {
                Id = id, Name = name
            };

            _graphClient.Cypher
            .Create("(sp:SitePoint {newsite})")
            .WithParam("newsite", newsite)
            .ExecuteWithoutResults();
        }
Пример #2
0
        private void linkRandom()
        {
            Random r   = new Random();
            var    all = getAllNodes();

            for (int i = 0; i < 200; i++)
            {
                SitePoint s = all[r.Next(0, all.Count)];
                SitePoint e = all[r.Next(0, all.Count)];
                addVisLine(s.Id, e.Id, 0);
            }
        }
Пример #3
0
        public void addSiteUnique(string name, long id)
        {
            var newsite = new SitePoint {
                Id = id, Name = name
            };

            _graphClient.Cypher
            .Merge("(sp:SitePoint { Id:{id} })")
            .OnCreate()
            .Set("sp={newsite}")
            .WithParams(new
            {
                id = newsite.Id,
                newsite
            })
            .ExecuteWithoutResults();
        }