mirror of https://github.com/abpframework/abp.git
8 changed files with 77 additions and 2 deletions
@ -0,0 +1,13 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
||||
|
|
||||
|
public class AbpApplicationConfigurationOptions |
||||
|
{ |
||||
|
public List<IApplicationConfigurationContributor> Contributors { get; } |
||||
|
|
||||
|
public AbpApplicationConfigurationOptions() |
||||
|
{ |
||||
|
Contributors = new List<IApplicationConfigurationContributor>(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
||||
|
|
||||
|
public class ApplicationConfigurationContributorContext : IServiceProviderAccessor |
||||
|
{ |
||||
|
public IServiceProvider ServiceProvider { get; } |
||||
|
|
||||
|
public ApplicationConfigurationDto ApplicationConfiguration { get; } |
||||
|
|
||||
|
public ApplicationConfigurationContributorContext(IServiceProvider serviceProvider, ApplicationConfigurationDto applicationConfiguration) |
||||
|
{ |
||||
|
ServiceProvider = serviceProvider; |
||||
|
ApplicationConfiguration = applicationConfiguration; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
||||
|
|
||||
|
public interface IApplicationConfigurationContributor |
||||
|
{ |
||||
|
Task ContributeAsync(ApplicationConfigurationContributorContext context); |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Data; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
||||
|
|
||||
|
public class TestApplicationConfigurationContributor : IApplicationConfigurationContributor |
||||
|
{ |
||||
|
public Task ContributeAsync(ApplicationConfigurationContributorContext context) |
||||
|
{ |
||||
|
context.ApplicationConfiguration.SetProperty("TestKey", "TestValue"); |
||||
|
return Task.CompletedTask; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue