You don't need to register any service or do anything else in Program or Startup class. Value used for checkbox must be of type bool?.