/// <summary>
 /// Constructor with params.
 /// </summary>
 /// <param name="key">Key.</param>
 public TranslateCommand(API_Config api)
 {
     if (api == null)
     {
         throw new ArgumentNullException(nameof(api));
     }
     else
     {
         _api = api;
     }
 }
Example #2
0
 public MarsRoverPhotos(API_Config api)
 {
     if (api == null)
     {
         throw new ArgumentNullException(nameof(api));
     }
     else
     {
         _api = api;
     }
 }
Example #3
0
 public AstronomyPicture(API_Config api)
 {
     if (api == null)
     {
         throw new ArgumentNullException(nameof(api));
     }
     else
     {
         _api = api;
     }
 }
        //! END section: Globals

        //! Section: Methods

        /// <summary>
        /// Constructor of the service that handles dependency injection of required services
        /// </summary>
        /// <param name="config">GitHub API configuration</param>
        /// <param name="restService">Service to perform basic REST request</param>
        /// <param name="graphQLService">Service to perform GraphQL requests</param>
        public GitHubService(IOptions <API_Config> config, IRESTService restService, IGraphQLService graphQLService)
        {
            _config         = config.Value;
            _restService    = restService;
            _graphQLService = graphQLService;
        }
Example #5
0
        //! END Section: Globals

        //! Section: Methods

        /// <summary>
        /// Constructor of the service that handles dependency injection of API secrets
        /// </summary>
        /// <param name="config">GitHub API configuration</param>
        public GraphQLService(IOptions <API_Config> config)
        {
            _config = config.Value;
        }