28 lines
		
	
	
		
			771 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			771 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using GerstITS.System.Configurations;
 | |
| using GerstITS.Web.Api.Swagger;
 | |
| using Microsoft.Extensions.Configuration;
 | |
| 
 | |
| namespace GerstITS.Examples.Api.Configurations;
 | |
| 
 | |
| internal sealed class LicenseConfiguration : ILicense, System.Configurations.IConfiguration
 | |
| {
 | |
|     #region Constructors
 | |
| 
 | |
|     public LicenseConfiguration(string parentPrefix, Microsoft.Extensions.Configuration.IConfiguration configuration)
 | |
|     {
 | |
|         var prefix = $"{parentPrefix}:{this.ToConfigurationPrefix()}";
 | |
| 
 | |
|         Name = configuration.GetValue<string>($"{prefix}:{nameof(Name)}");
 | |
|         Url = configuration.GetValue<Uri>($"{prefix}:{nameof(Url)}");
 | |
|     } 
 | |
|         
 | |
|     #endregion
 | |
| 
 | |
|     #region ILicence
 | |
| 
 | |
|     public string Name { get; }
 | |
|     public Uri Url { get; }
 | |
| 
 | |
|     #endregion
 | |
| } |