Ejemplo n.º 1
0
        public async Task <SynchroResponse> SendRevitElementToCloud(string modelid, SynchroBody body)
        {
            var synchroRepository = new SynchronizationRepository();
            var response          = await synchroRepository.CreateSynchronization(modelid, body);

            return(response);
        }
Ejemplo n.º 2
0
        public async Task <SynchroResponse> CreateSynchronization(string modelId, SynchroBody body)
        {
            var           route         = new SynchronizationRoute(modelId);
            RestSharpBase restSharpBase = new RestSharpBase(route.PostGetUrl, Method.POST);
            RestRequest   req           = restSharpBase.Request;

            req.AddJsonBody(body);
            var response = await _client.ExecuteAsync <SynchroResponse>(req);

            switch ((int)response.StatusCode)
            {
            case 200:
                return(response.Data);

            default:
                throw new System.Exception(response.StatusDescription);
            }
        }