/// <summary> /// Adds and configures hardware support. /// </summary> public static IHostBuilder ConfigureHardware(this IHostBuilder builder, HardwareOptionsDelegate options) { var hardware = new Mainboard(options).Connect(); builder.ConfigureServices((context, services) => services.AddSingleton(typeof(IHardware), hardware)); return(builder); }
/// <summary> /// Initializes a new instance of the <see cref="Mainboard"/> class. /// </summary> /// <param name="configure">The configuration options of <see cref="Mainboard"/> specific features.</param> public Mainboard(HardwareOptionsDelegate configure) { var options = new HardwareOptions(); configure(options); _options = options; }