-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Nerosoft.Euonia.Modularity; | ||
|
||
/// <summary> | ||
/// | ||
/// Contains methods to create new instance of <see cref="IApplicationWithServiceProvider"/>. | ||
/// </summary> | ||
public static class ApplicationFactory | ||
{ | ||
/// <summary> | ||
/// | ||
/// Create new instance of <see cref="IApplicationWithServiceProvider"/>. | ||
/// </summary> | ||
/// <param name="services"></param> | ||
/// <param name="optionsAction"></param> | ||
/// <typeparam name="TStartupModule"></typeparam> | ||
/// <returns></returns> | ||
public static IApplicationWithServiceProvider Create<TStartupModule>(IServiceCollection services, Action<ApplicationCreationOptions> optionsAction = null) | ||
public static IApplicationWithServiceProvider Create<TStartupModule>(IServiceCollection services, IConfiguration configuration, Action<ApplicationCreationOptions> optionsAction = null) | ||
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (7.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (7.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (7.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 18 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
|
||
where TStartupModule : IModuleContext | ||
{ | ||
return Create(typeof(TStartupModule), services, optionsAction); | ||
return Create(typeof(TStartupModule), services, configuration, optionsAction); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// Create new instance of <see cref="IApplicationWithServiceProvider"/>. | ||
/// </summary> | ||
/// <param name="startupModuleType"></param> | ||
/// <param name="services"></param> | ||
/// <param name="optionsAction"></param> | ||
/// <returns></returns> | ||
public static IApplicationWithServiceProvider Create(Type startupModuleType, IServiceCollection services, Action<ApplicationCreationOptions> optionsAction = null) | ||
public static IApplicationWithServiceProvider Create(Type startupModuleType, IServiceCollection services, IConfiguration configuration, Action<ApplicationCreationOptions> optionsAction = null) | ||
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (7.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (7.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
Check warning on line 31 in Source/Euonia.Modularity/Core/ApplicationFactory.cs GitHub Actions / build (6.0.x, Release)
|
||
{ | ||
return new ApplicationWithServiceProvider(startupModuleType, services, optionsAction); | ||
return new ApplicationWithServiceProvider(startupModuleType, services, configuration, optionsAction); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
namespace Nerosoft.Euonia.Modularity; | ||
|
||
/// <summary> | ||
/// This interface defines a contract for a type finder that retrieves an read-only list of types. | ||
/// </summary> | ||
public interface ITypeFinder | ||
{ | ||
/// <summary> | ||
/// Gets the list of types. | ||
/// </summary> | ||
IReadOnlyList<Type> Types { get; } | ||
} |