Пример #1
0
        /// <summary>
        /// Returns an instantiation of a <see cref="DataService"/> class, with a custom
        /// base URI, a custom authentication provider, and logging.
        /// </summary>
        /// <param name="authToken">The OAuth token.</param>
        /// <returns>An instance of a data service.</returns>
        internal static DataService CreateDataService_CustomBaseUriAndAuthProviderWithLogging(string authToken, ILogger logger)
        {
            var connectInfo  = new ConnectionInfo("https://some.test.server/api/v1");
            var authProvider = new CustomAuthProvider();

            return(new DataService(
                       new DataServiceContext(connectInfo, authProvider),
                       logger));
        }
Пример #2
0
        /// <summary>
        /// Returns an instantiation of a <see cref="DataService"/> class, with a custom
        /// authentication provider and logging.
        /// </summary>
        /// <param name="authToken">The OAuth token.</param>
        /// <returns>An instance of a data service.</returns>
        internal static DataService CreateDataService_CustomAuthProviderWithLogging(string authToken, ILogger logger)
        {
            var authProvider = new CustomAuthProvider();

            return(new DataService(new DataServiceContext(authProvider), logger));
        }