Exemplo n.º 1
0
        /// <summary>
        /// Converts the given node to a redis node.
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public static RedisNode ConvertTo(Node node)
        {
            RedisNode redisNode = new RedisNode();
            redisNode.Id = node.Id.Value;
            redisNode.Latitude = node.Latitude.Value;
            redisNode.Longitude = node.Longitude.Value;
            redisNode.ChangeSetId = node.ChangeSetId;
            redisNode.TimeStamp = node.TimeStamp;
            redisNode.UserId = node.UserId;
            redisNode.UserName = node.UserName;
            redisNode.Version = node.Version;
            redisNode.Visible = node.Visible;
            redisNode.Tags = PrimitiveExtensions.ConvertTo(node.Tags);

            return redisNode;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts the given node from a redis node.
        /// </summary>
        /// <param name="redisNode"></param>
        /// <returns></returns>
        public static Node ConvertFrom(RedisNode redisNode)
        {
            Node node = new Node();
            node.Id = redisNode.Id.Value;
            node.Latitude = redisNode.Latitude.Value;
            node.Longitude = redisNode.Longitude.Value;
            node.ChangeSetId = redisNode.ChangeSetId;
            node.TimeStamp = redisNode.TimeStamp;
            node.UserId = redisNode.UserId;
            node.UserName = redisNode.UserName;
            node.Version = redisNode.Version;
            node.Visible = redisNode.Visible;
            node.Tags = PrimitiveExtensions.ConvertFrom(redisNode.Tags);

            return node;
        }