Beispiel #1
0
        public async Task CreateUserAsync(User user)
        {
            var query = $"g.addV().property('id', '{user.Id}')"
                        + $".property('firstName', '{user.FirstName}')"
                        + $".property('lastName', '{user.LastName}')";

            await _gremlinClient.SubmitAsync(query);
        }
Beispiel #2
0
        public async Task CreateRelationshipAsync(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            if (user.Relationships == null)
            {
                return;
            }

            foreach (var relationship in user.Relationships)
            {
                var query = $"g.V('{user.Id}').addE('{relationship.Type}').to(g.V('{relationship.ToUserId}'))";
                await _gremlinClient.SubmitAsync(query);
            }
        }