| | 1 | | namespace Gateway; |
| | 2 | |
|
| | 3 | | public class ServiceMetadata |
| | 4 | | { |
| | 5 | | public required string ServiceName { get; set; } |
| | 6 | | public Uri? BluePrintUri { get; set; } |
| | 7 | | public required string Description { get; set; } |
| | 8 | | public string? ContactEmail { get; set; } |
| | 9 | | public string? ContactName { get; set; } |
| | 10 | | public Uri? LicenseUri { get; set; } |
| | 11 | | public required string License { get; set; } |
| | 12 | | public Uri? TermsOfService { get; set; } |
| | 13 | | } |
| | 14 | |
|
| | 15 | | public static class ServiceMetadataRegistration |
| | 16 | | { |
| | 17 | | public static ServiceMetadata AddServiceMetadata(this WebApplicationBuilder builder) |
| | 18 | | { |
| 0 | 19 | | builder.Services.Configure<ServiceMetadata>( |
| 0 | 20 | | builder.Configuration.GetRequiredSection(nameof(ServiceMetadata)) |
| 0 | 21 | | ); |
| 0 | 22 | | var serviceMetadata = new ServiceMetadata() |
| 0 | 23 | | { |
| 0 | 24 | | ServiceName = string.Empty, |
| 0 | 25 | | Description = string.Empty, |
| 0 | 26 | | License = string.Empty |
| 0 | 27 | | }; |
| | 28 | |
|
| 0 | 29 | | builder.Configuration.GetSection(nameof(ServiceMetadata)).Bind(serviceMetadata); |
| 0 | 30 | | return serviceMetadata; |
| | 31 | | } |
| | 32 | | } |