Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of change to controller to take IMyAppSettings as the parameter instead of IOptionsSnapshot<MyAppSettings>
public class HomeController : Controller
{
private readonly IMyAppSettings _settings;
public HomeController(IMyAppSettings settings)
{
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
}
public IActionResult Index()
{
return View(_settings);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.