// private object ex;

        public PointsOfInterestsController(ILogger <PointsOfInterestsController> logger,
                                           LocalMailService mailService)
        {
            _logger      = logger;
            _mailService = mailService;
            //  HttpContext.RequestServices.GetService()//Provides access to http contianer
        }
示例#2
0
 public PointsOfInterestController(ILogger <PointsOfInterestController> logger,
                                   LocalMailService mailService)
 {
     _logger      = logger;
     _mailService = mailService;
     // HttpContext.RequestServices.GetService();
 }
示例#3
0
 public PointOfInterestController(ILogger <PointOfInterestController> logger,
                                  LocalMailService mailService,
                                  ICityInfoRepository cityInfoRepository)
 {
     _logger             = logger;
     _mailService        = mailService;
     _cityInfoRepository = cityInfoRepository;
     //  HttpContext.RequestServices.GetService()
 }
示例#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;
 }
示例#5
0
 //logger dependency injection
 public PointsOfInterestController(ILogger <PointsOfInterestController> logger, LocalMailService mailService)
 {
     _logger      = logger;
     _mailService = mailService;
 }
示例#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);
 }