mirror of https://github.com/abpframework/abp.git
committed by
GitHub
333 changed files with 2550 additions and 2458 deletions
@ -0,0 +1,18 @@ |
|||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Volo.Abp.Threading; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.TestBase; |
||||
|
|
||||
|
internal class TestStartup<TStartupModule> |
||||
|
{ |
||||
|
public void ConfigureServices(IServiceCollection services) |
||||
|
{ |
||||
|
AsyncHelper.RunSync(() => services.AddApplicationAsync(typeof(TStartupModule))); |
||||
|
} |
||||
|
|
||||
|
public void Configure(IApplicationBuilder app) |
||||
|
{ |
||||
|
AsyncHelper.RunSync(app.InitializeApplicationAsync); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
using System; |
||||
|
using System.Linq; |
||||
|
using System.Reflection; |
||||
|
|
||||
|
namespace Volo.Abp.Modularity; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Used to define additional assemblies for a module.
|
||||
|
/// </summary>
|
||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] |
||||
|
public class AdditionalAssemblyAttribute : Attribute, IAdditionalModuleAssemblyProvider |
||||
|
{ |
||||
|
public Type[] TypesInAssemblies { get; } |
||||
|
|
||||
|
public AdditionalAssemblyAttribute(params Type[]? typesInAssemblies) |
||||
|
{ |
||||
|
TypesInAssemblies = typesInAssemblies ?? Type.EmptyTypes; |
||||
|
} |
||||
|
|
||||
|
public virtual Assembly[] GetAssemblies() |
||||
|
{ |
||||
|
return TypesInAssemblies.Select(t => t.Assembly).Distinct().ToArray(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
using System.Reflection; |
||||
|
|
||||
|
namespace Volo.Abp.Modularity; |
||||
|
|
||||
|
public interface IAdditionalModuleAssemblyProvider |
||||
|
{ |
||||
|
Assembly[] GetAssemblies(); |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue