StaffCoder
.NET
.NET.NET 10
12 modules · 48 challengesSign up
Modules12 modules · 48 challenges
Learn how an application reads its settings: binding a configuration section to a typed class, layering files and environment variables so the right value wins, and refusing to start when a setting is wrong.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Typed Smtp Settings

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

This problem covers binding a configuration section to a typed settings class with the options pattern, and receiving those settings in a service through IOptions.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Environment Override Precedence

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

This problem covers layering configuration from a base file, an environment specific file and environment variables, so each setting comes from the highest source that defines it.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Fail-Fast Options Validation

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

This problem covers adding validation attributes to an options class and checking them as the application starts, so a bad setting stops it with an error naming that setting.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Payment Gateway Settings Module

STAR
Solving it completes the module
100%1 of 1 solvedeasy
About this challenge

This problem covers layering the payment settings from files and environment variables, binding the nested gateway and retry sections to typed options, validating them at startup, and reading them in a service through IOptions.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.