コード例 #1
0
        public async Task <LinkedServiceGetResponse> GetAsync(
            string resourceGroupName,
            string dataFactoryName,
            string linkedServiceName,
            CancellationToken cancellationToken)
        {
            Core.Models.LinkedServiceGetResponse response =
                await this.Client.InternalClient.LinkedServices.GetAsync(
                    resourceGroupName,
                    dataFactoryName,
                    linkedServiceName,
                    cancellationToken);

            return(new LinkedServiceGetResponse(response, this.Client));
        }
コード例 #2
0
        /// <summary>
        /// Deserializes the given json into an Hydra OM InternalLinkedService instance,
        /// by mocking a get request to exercise the client's deserialization logic.
        /// </summary>
        /// <param name="json">The JSON string to deserialize.</param>
        /// <returns></returns>
        internal static Models.LinkedService DeserializeInternalLinkedServiceJson(string json)
        {
            var handler = new MockResourceProviderDelegatingHandler()
            {
                Json = json
            };

            var    client            = GetFakeClient(handler);
            string resourceGroupName = Guid.NewGuid().ToString("D");
            string dataFactoryName   = Guid.NewGuid().ToString("D");
            string linkedServiceName = Guid.NewGuid().ToString("D");

            Models.LinkedServiceGetResponse getResponse = client.LinkedServices.Get(
                resourceGroupName,
                dataFactoryName,
                linkedServiceName);

            return(getResponse.LinkedService);
        }