December 2019
Intermediate to advanced
528 pages
11h 19m
English
Our next task is to move our only remaining hard coded variable into the appsettings.json file. Let's have a quick look at what that might look like in the configuration file:
{ "ConnectionStrings": { "netcodephotostorage": "DefaultEndpointsProtocol=https;AccountName=netcodephotostorage;AccountKey=A1SYv0myUdUnjXW8oojxJ60PPGY1zCwaAyvvcHz0C7WSDEximNfl6UbtGXli+i0plAxb1S3w5pR9deBQ50kFGQ==;EndpointSuffix=core.windows.net" }, "MonitorPath": "c:\\tmp"}
Okay, so our next stage will be to use it. There are a number of ways to achieve this; we could read each configuration value as it's needed or, as we will do here, we could read all the configuration at the beginning and pass the values around. Let's create a new class to hold ...
Read now
Unlock full access