Exemple #1
0
        public void Init()
        {
            CoverGraphDatabaseSettings settings = new CoverGraphDatabaseSettings()
            {
                DatabaseLogin    = "******",
                DatabasePassword = "******",
                Url = "http://localhost:7474/db/data"
            };
            CoverGraphDatabaseClientFactory factory = new CoverGraphDatabaseClientFactory(settings);

            _userRepository = new UserRepository(factory);
        }
Exemple #2
0
        public UserRepository(CoverGraphDatabaseClientFactory factory)
        {
            _client = factory.GetClient();
            _client.Connect();
            var count = _client.Cypher
                        .Match("(n)")
                        .Return <int>("count(n)").Results
                        .FirstOrDefault();

            if (count == 0)
            {
                _client.Cypher
                .CreateUniqueConstraint("n:User", "n.login");
            }
        }