A domain-specific image analysis model.
        /// <summary>
        /// Sends a url to Project Oxford and performs analysis against a given domain
        /// </summary>
        /// <param name="imageUrl">The url of the image to analyze</param>
        /// <param name="domainModel">The domain model to analyze against</param>
        /// <returns></returns>
        private async Task<AnalysisInDomainResult> AnalyzeInDomainUrl(string imageUrl, Model domainModel)
        {
            // -----------------------------------------------------------------------
            // KEY SAMPLE CODE STARTS HERE
            // -----------------------------------------------------------------------

            //
            // Create Project Oxford Vision API Service client
            //
            VisionServiceClient VisionServiceClient = new VisionServiceClient(SubscriptionKey);
            Log("VisionServiceClient is created");

            //
            // Analyze the url against the given domain
            //
            Log("Calling VisionServiceClient.AnalyzeImageInDomainAsync()...");
            AnalysisInDomainResult analysisResult = await VisionServiceClient.AnalyzeImageInDomainAsync(imageUrl, domainModel);
            return analysisResult;

            // -----------------------------------------------------------------------
            // KEY SAMPLE CODE ENDS HERE
            // -----------------------------------------------------------------------
        }
        /// <summary>
        /// Uploads the image to Project Oxford and performs analysis against a given domain
        /// </summary>
        /// <param name="imageFilePath">The image file path.</param>
        /// <param name="domainModel">The domain model to analyze against</param>
        /// <returns></returns>
        private async Task<AnalysisInDomainResult> UploadAndAnalyzeInDomainImage(string imageFilePath, Model domainModel)
        {
            // -----------------------------------------------------------------------
            // KEY SAMPLE CODE STARTS HERE
            // -----------------------------------------------------------------------

            //
            // Create Project Oxford Vision API Service client
            //
            VisionServiceClient VisionServiceClient = new VisionServiceClient(SubscriptionKey);
            Log("VisionServiceClient is created");

            using (Stream imageFileStream = File.OpenRead(imageFilePath))
            {
                //
                // Analyze the image for the given domain
                //
                Log("Calling VisionServiceClient.AnalyzeImageInDomainAsync()...");
                AnalysisInDomainResult analysisResult = await VisionServiceClient.AnalyzeImageInDomainAsync(imageFileStream, domainModel);
                return analysisResult;
            }

            // -----------------------------------------------------------------------
            // KEY SAMPLE CODE ENDS HERE
            // -----------------------------------------------------------------------
        }
 /// <summary>
 /// Analyzes the image using a domain-specific model.
 /// </summary>
 /// <param name="imageStream">The image stream.</param>
 /// <param name="model">Domain-specific model.</param>
 /// <remarks>The list of currently aailable models can be listed via the <see cref="ListModelsAsync"/> method.</remarks>
 /// <returns>The AnalysisInDomainResult object.</returns>
 public async Task <AnalysisInDomainResult> AnalyzeImageInDomainAsync(Stream imageStream, Microsoft.ProjectOxford.Vision.Contract.Model model)
 {
     return(await AnalyzeImageInDomainAsync(imageStream, model.Name).ConfigureAwait(false));
 }