예제 #1
0
        public OrientRepo(
            IJsonManger jsonManager_, ITokenBuilder tokenBuilder_, ITypeConverter typeConverter_, ITextBuilder textBuilder_,
            IWebManager webManger_, IResponseReader responseReader_)
        {
            this.jm  = jsonManager_;
            this.tb  = tokenBuilder_;
            this.tk  = typeConverter_;
            this.txb = textBuilder_;
            this.wm  = webManger_;
            this.ir  = responseReader_;

            AuthUrl    = txb.Build(TokenRepo.authUrl, new OrientAuthenticationURLFormat());
            CommandUrl = txb.Build(TokenRepo.commandUrl, new OrientCommandURLFormat());
        }
예제 #2
0
        public string Add(IOrientObject obj_)
        {
            string            content   = jm.SerializeObject(obj_);
            List <ITypeToken> commandTk = tb.Command(new OrientCreateToken(), obj_, obj_, new TextToken()
            {
                Text = content
            });
            string command = txb.Build(commandTk, new OrientCreateVertexCluaseFormat());

            queryUrl = CommandUrl + "/" + command;

            owm.Authenticate(AuthUrl,
                             new NetworkCredential(ConfigurationManager.AppSettings["ParentLogin"], ConfigurationManager.AppSettings["ParentPassword"]));

            string resp =
                ir.ReadResponse(
                    owm.GetResponse(queryUrl, new POST().Text)
                    );

            return(resp);
        }