- Create a console application
- Create a service contract IHelloService with a Hello method
- Create HelloController with constructor injection using the IHelloService, and a Greeting method using the IHelloService
- Create a concrete imlpementation for the IHelloService
- Use the HelloController from the Program class
- Add the NuGet package Microsoft.Extensions.DependendyInjection
- Register services IHelloService and HelloController with the container
- Use the HelloController by getting a reference from the container
Questions:
- How is the HelloController instantiated?
- What happens if the IHelloService implementation cannot be found?
- Create a console application
- Add NuGet packages for Microsoft.Extensions.Configuration.
- Create a configuration builder
- Create a JSON configuration file to store a connection string
- Configure the application to invoke it using paramters, e.g. a=42
- Read the configuration values from the application
- Add User Secrets to the program, to read user secrets
Questions:
- How can inner sections be retrieved?
- Is it possible to get all configured values?
- What happens if the same value is configured multiple times?
- What are user secrets good for?
- Create a console application
- Add NuGet packages for "Microsoft.Extensions.Logging.*"
- Create a logging factory to set up logging, write logs to the console
- Write log messages from your Main program
Questions:
- Why another logging framework?
- Does the logging framework support severity levels?
- Does the logging framework support scopes?
- Can logging be configured to use NLog?