| | |
| | | using Autofac.Core; |
| | | using WIDESEAWCS_QuartzJob.QuartzExtensions; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using WIDESEA_SerialPortService; |
| | | //using WIDESEA_SerialPortService; |
| | | using WIDESEA_ISerialPortService; |
| | | |
| | | var builder = WebApplication.CreateBuilder(args); |
| | |
| | | //builder.Services.AddSingleton<SerialPortTestService>(sp => |
| | | // new SerialPortTestService("COM3")); // è¿éå¯ä»¥ä¼ å
¥ä¸²å£å· |
| | | |
| | | // 注å
¥ SerialPortService |
| | | builder.Services.AddScoped<ISerialPortService, SerialPortService>(); |
| | | //// 注å ISerialPortService å®ç° |
| | | //builder.Services.AddSingleton<ISerialPortService, SerialPortService>(); |
| | | |
| | | // 注å SerialPortTestServiceï¼å¹¶æ³¨å
¥ ISerialPortService |
| | | //builder.Services.AddSingleton<SerialPortTestJob>(sp => |
| | | //{ |
| | | // var serialPortService = sp.GetRequiredService<ISerialPortService>(); |
| | | // return new SerialPortTestJob("COM3", serialPortService); |
| | | //}); |
| | | |
| | | //// 注å
¥ SerialPortService |
| | | //builder.Services.AddScoped<ISerialPortService, SerialPortService>(); |
| | | |
| | | builder.Services.AddSession(); |
| | | |