mirror of https://github.com/abpframework/abp
#82 Introduce IAbpApplication and other interface and base classes to sperate internal and external service provider based applications.
parent
977f7f59b8
commit
754a711c24
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Volo.Abp.Modularity;
|
||||
|
||||
namespace Volo.Abp
|
||||
{
|
||||
public static class AbpApplicationFactory
|
||||
{
|
||||
public static IAbpApplicationWithExternalServiceProvider Create<TStartupModule>(
|
||||
[NotNull] IServiceCollection services)
|
||||
where TStartupModule : IAbpModule
|
||||
{
|
||||
return Create<TStartupModule>(services, null);
|
||||
}
|
||||
|
||||
public static IAbpApplicationWithExternalServiceProvider Create<TStartupModule>(
|
||||
[NotNull] IServiceCollection services,
|
||||
[CanBeNull] Action<AbpApplicationCreationOptions> optionsAction)
|
||||
where TStartupModule : IAbpModule
|
||||
{
|
||||
return new AbpApplicationWithExternalServiceProvider(typeof(TStartupModule), services, optionsAction);
|
||||
}
|
||||
|
||||
public static IAbpApplicationWithExternalServiceProvider Create(
|
||||
[NotNull] Type startupModuleType,
|
||||
[NotNull] IServiceCollection services)
|
||||
{
|
||||
return Create(startupModuleType, services, null);
|
||||
}
|
||||
|
||||
public static IAbpApplicationWithExternalServiceProvider Create(
|
||||
[NotNull] Type startupModuleType,
|
||||
[NotNull] IServiceCollection services,
|
||||
[CanBeNull] Action<AbpApplicationCreationOptions> optionsAction)
|
||||
{
|
||||
return new AbpApplicationWithExternalServiceProvider(startupModuleType, services, optionsAction);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Volo.Abp.Modularity;
|
||||
|
||||
namespace Volo.Abp
|
||||
{
|
||||
public interface IAbpApplication
|
||||
{
|
||||
Type StartupModuleType { get; }
|
||||
|
||||
IServiceProvider ServiceProvider { get; }
|
||||
|
||||
AbpModuleDescriptor[] Modules { get; }
|
||||
|
||||
void Shutdown();
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Volo.Abp
|
||||
{
|
||||
public interface IAbpApplicationWithExternalServiceProvider : IAbpApplication
|
||||
{
|
||||
void Initialize([NotNull] IServiceProvider serviceProvider);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue