/// <summary> /// Constructor for Json data access. This takes hosting environment context /// </summary> /// <param name="hostingEnvironment"></param> /// <param name="mapper">Object mapper</param> /// <param name="mapService">Map api</param> /// <param name="mapResponseProcessor">Map response processor</param> /// <param name="configuration">Configuration provider</param> public JsonDataAccess(IHostingEnvironment hostingEnvironment, IMapper mapper, IMapService mapService, IMapResponseProcessor mapResponseProcessor, IConfiguration configuration) { _mapService = mapService; string contentRootPath = hostingEnvironment.ContentRootPath; JsonPath = $"{contentRootPath}{Path.DirectorySeparatorChar}Data{Path.DirectorySeparatorChar}{Path.DirectorySeparatorChar}markers.json"; _mapper = mapper; _mapResponseProcessor = mapResponseProcessor; _configuration = configuration; }
/// <summary> /// Constructor used for dependency injection /// </summary> /// <remarks> /// <param name="dataAccess"></param> public MapController(IDataAccess dataAccess, IMapper mapper, IMapResponseProcessor mapResponseProcessor) { _dataAccess = dataAccess; _mapper = mapper; _mapResponseProcessor = mapResponseProcessor; }