Ejemplo n.º 1
0
        public CreateEntityTask(
            GetEntitiesUrlBuilder <T> createEntityBuilder,
            HttpClient httpClient)
        {
            this.createEntityBuilder = createEntityBuilder;
            this.httpClient          = httpClient;

            this.Validate();
        }
        public void SetUp()
        {
            IRestServiceGrammar restGrammar   = RestServiceGrammar.ItemSSCV2Grammar();
            ISSCUrlParameters   webApiGrammar = SSCUrlParameters.ItemSSCV2UrlParameters();

            this.getEntityBuilder = new GetEntitiesUrlBuilder <IBaseEntityRequest>(restGrammar, webApiGrammar);

            SessionConfigPOD mutableSession = new SessionConfigPOD();

            mutableSession.InstanceUrl = "http://mobiledev1ua1.dk.sitecore.net";
            this.sessionConfig         = mutableSession;
        }
        public async Task <ScEntityResponse> ReadEntityAsync(IReadEntitiesByPathRequest request, CancellationToken cancelToken = default(CancellationToken))
        {
            IReadEntitiesByPathRequest requestCopy = request.DeepCopyReadEntitiesByPathRequest();

            //await this.GetPublicKeyAsync(cancelToken);
            IReadEntitiesByPathRequest autocompletedRequest = this.requestMerger.FillReadEntitiesByPathGaps(requestCopy);

            var urlBuilder = new GetEntitiesUrlBuilder <IReadEntitiesByPathRequest>(this.restGrammar, this.sscGrammar);
            var taskFlow   = new GetEntitiesByPathTask(urlBuilder, this.httpClient);

            return(await RestApiCallFlow.LoadRequestFromNetworkFlow(autocompletedRequest, taskFlow, cancelToken));
        }
 public void TearDown()
 {
     this.getEntityBuilder = null;
     this.sessionConfig    = null;
 }
Ejemplo n.º 5
0
 public GetEntitiesByPathTask(GetEntitiesUrlBuilder <IReadEntitiesByPathRequest> urlBuilder, HttpClient httpClient)
     : base(httpClient)
 {
     this.urlBuilder = urlBuilder;
 }