Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="MobileDataClient"/>
        /// </summary>
        /// <param name="endpoint">The <see cref="Uri"/> to the backend service</param>
        /// <param name="credential">The <see cref="TokenCredential"/> for authentication</param>
        /// <param name="options">The client options for this connection</param>
        public MobileDataClient(Uri endpoint, TokenCredential credential, MobileDataClientOptions options)
        {
            Arguments.IsNotNull(endpoint, nameof(endpoint));
            Arguments.IsNotNull(options, nameof(options));

            if (!endpoint.IsAbsoluteUri)
            {
                throw new ArgumentException("Endpoint must be an absolute Uri", nameof(endpoint));
            }

            Endpoint      = endpoint;
            Credential    = credential;
            ClientOptions = options;
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="MobileDataClient"/>
 /// </summary>
 /// <param name="endpoint">The <see cref="Uri"/> to the backend service</param>
 /// <param name="options">The client options for this connection</param>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="endpoint"/> is <c>null</c>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     <paramref name="endpoint"/> is not an absolute Uri.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="options"/> is <c>null</c>.
 /// </exception>
 public MobileDataClient(Uri endpoint, MobileDataClientOptions options)
     : this(endpoint, null, options)
 {
 }