| | 1 | | using Fluorite.Strainer.Services.Metadata; |
| | 2 | | using Fluorite.Strainer.Services.Modules; |
| | 3 | |
|
| | 4 | | namespace Fluorite.Strainer.Services.Configuration; |
| | 5 | |
|
| | 6 | | public class PlainModuleLoadingStrategy : IPlainModuleLoadingStrategy, IModuleLoadingStrategy |
| | 7 | | { |
| | 8 | | private readonly IPropertyInfoProvider _propertyInfoProvider; |
| | 9 | | private readonly IStrainerOptionsProvider _strainerOptionsProvider; |
| | 10 | |
|
| 10 | 11 | | public PlainModuleLoadingStrategy( |
| 10 | 12 | | IPropertyInfoProvider propertyInfoProvider, |
| 10 | 13 | | IStrainerOptionsProvider strainerOptionsProvider) |
| | 14 | | { |
| 10 | 15 | | _propertyInfoProvider = Guard.Against.Null(propertyInfoProvider); |
| 10 | 16 | | _strainerOptionsProvider = Guard.Against.Null(strainerOptionsProvider); |
| 10 | 17 | | } |
| | 18 | |
|
| | 19 | | public void Load(IStrainerModule strainerModule) |
| | 20 | | { |
| 5 | 21 | | Guard.Against.Null(strainerModule); |
| | 22 | |
|
| 5 | 23 | | var options = _strainerOptionsProvider.GetStrainerOptions(); |
| 5 | 24 | | var builder = new StrainerModuleBuilder(_propertyInfoProvider, strainerModule, options); |
| | 25 | |
|
| 5 | 26 | | strainerModule.Load(builder); |
| 5 | 27 | | } |
| | 28 | | } |