|
10 | 10 | using Microsoft.Extensions.Hosting; |
11 | 11 | using Microsoft.Extensions.Logging; |
12 | 12 |
|
13 | | -internal class MainService(Settings settings, ILogger logger, IHostApplicationLifetime lifetime) : BackgroundService |
| 13 | +/// <summary> |
| 14 | +/// Inspects an assembly for <see cref="GeneratedJsonSchemaAttribute"/> |
| 15 | +/// annotations and emits the json schemata provided by them to a directory. |
| 16 | +/// </summary> |
| 17 | +/// <param name="settings"> |
| 18 | +/// The object providing settings to the service. |
| 19 | +/// </param> |
| 20 | +/// <param name="logger"> |
| 21 | +/// The logger to use when logging progress. |
| 22 | +/// </param> |
| 23 | +/// <param name="lifetime"> |
| 24 | +/// The lifetime of the application hosting the service. When done, the service |
| 25 | +/// will stop the application via this object. |
| 26 | +/// </param> |
| 27 | +public sealed class MainService(Settings settings, ILogger logger, IHostApplicationLifetime lifetime) : BackgroundService |
14 | 28 | { |
15 | 29 | private static readonly JsonSerializerOptions _schemaSerializationOptions = new(JsonSerializerDefaults.General) |
16 | 30 | { |
17 | 31 | WriteIndented = true, |
18 | 32 | PropertyNamingPolicy = null |
19 | 33 | }; |
20 | | - |
| 34 | + /// <summary> |
| 35 | + /// Creates a new instance of the service. |
| 36 | + /// </summary> |
| 37 | + /// <param name="settings"> |
| 38 | + /// The object providing settings to the service. |
| 39 | + /// </param> |
| 40 | + /// <param name="loggerFactory"> |
| 41 | + /// The factory to use when creating a logger to use when logging progress. |
| 42 | + /// </param> |
| 43 | + /// <param name="lifetime"> |
| 44 | + /// The lifetime of the application hosting the service. When done, the |
| 45 | + /// service will stop the application via this object. |
| 46 | + /// </param> |
| 47 | + /// <returns> |
| 48 | + /// A new service instance. |
| 49 | + /// </returns> |
21 | 50 | public static MainService Create(Settings settings, ILoggerFactory loggerFactory, IHostApplicationLifetime lifetime) => |
22 | 51 | new(settings, loggerFactory.CreateLogger<MainService>(), lifetime); |
23 | | - |
| 52 | + /// <inheritdoc/> |
24 | 53 | protected override async Task ExecuteAsync(CancellationToken stoppingToken) |
25 | 54 | { |
26 | 55 | stoppingToken.ThrowIfCancellationRequested(); |
|
0 commit comments