// private object ex;

        public PointsOfInterestsController(ILogger <PointsOfInterestsController> logger,
                                           LocalMailService mailService)
        {
            _logger      = logger;
            _mailService = mailService;
            //  HttpContext.RequestServices.GetService()//Provides access to http contianer
        }
Esempio n. 2
0
 public PointsOfInterestController(ILogger <PointsOfInterestController> logger,
                                   LocalMailService mailService)
 {
     _logger      = logger;
     _mailService = mailService;
     // HttpContext.RequestServices.GetService();
 }
Esempio n. 3
0
 public PointOfInterestController(ILogger <PointOfInterestController> logger,
                                  LocalMailService mailService,
                                  ICityInfoRepository cityInfoRepository)
 {
     _logger             = logger;
     _mailService        = mailService;
     _cityInfoRepository = cityInfoRepository;
     //  HttpContext.RequestServices.GetService()
 }
Esempio n. 4
0
 public PointsOfInterestController(ILogger <PointsOfInterestController> logger,
                                   LocalMailService mailService,
                                   ICityInfoRepository cityInfoRepository)
 {
     // linjecting through constructor, if it's not feasible, it can also be injected as following:
     //HttpContext.RequestServices.GetService()...
     _logger             = logger;
     _mailService        = mailService;
     _cityInfoRepository = cityInfoRepository;
 }
Esempio n. 5
0
 //logger dependency injection
 public PointsOfInterestController(ILogger <PointsOfInterestController> logger, LocalMailService mailService)
 {
     _logger      = logger;
     _mailService = mailService;
 }
Esempio n. 6
0
 public PointsOfInterestController(ILogger <PointsOfInterestController> logger, LocalMailService mailService)
 {
     _logger      = logger; //Example of Constructor Injection. The reccomended method of dependency injection
     _mailService = mailService;
     //HttpContext.RequestServices.GetService(PointsOfInterestController logger);
 }